« first day (1888 days earlier)      last day (3285 days later) » 

18:00
because you are still in an array
Finally!! I'm going from 10Mb broadband (basically, 800KB down) to 40Mb broadband (30MB down, 4MB up) :D
It's 2015, about bloody time!
I need to beer myself ... brb, shopping
ugh, dat config file
morning
@tereško - cheers then ! ;)
18:01
hi php experts
I need your help guys
@Jimbo cool, is it unlimited 4G on your phone, or you have a data cap?
@happy - good night :|
Many people came and commented on my question. but no one can give solution for my question
@tereško Nope, I did have unlimited 3G on my phone, tethering as well (played Xbox Live over it all the time when I was at Uni), but as soon as I upgraded to 4G, the contract removed the unlimited tethering. Now it's a 4GB cap :( But this broadband is home broadband that I'm talking about
@bwoebi I updated the gist with a version that uses a socket pair. gist.github.com/trowski/b5cdf8a1fea2219b9947
18:02
Guys..please respond to me atleash.
atleast*
@Trowski thanks :-)
My messages receiving or not?
@Ganesh That is the first actual question you have asked.
And yes, we can see them.
Oh thanks
But we don't tend to genuflect to people upon their entering a room.
18:03
@bwoebi Clone github.com/icicleio/socket and put that in the examples directory and it should work straight away.
@Danack HEY! HEY! HEY! LOOK AT ME! PAY ATTENTION TO ME!!!!! DANAAAAAAAACK!
*after composer install of course
@Trowski looks like you forgot the composer step :-P …^^
hehe
This is my actual question...

http://stackoverflow.com/questions/34339567/how-to-use-other-languages-in-php-echo-or-print/34340476?noredirect=1#comment56422945_34340476
18:04
Almost did, hehe
i don't want anyone to genuflect... i just need help...
Atleast u responded me.. thanks
@Ganesh Why are you calling json_encode() if you don't want a JSON encoded string?
18:08
the finger is intensifying
I don't know Sara, i saw from some tutorial
Hey anybody saw the movie let the right one in?
@TheGuy it is always morning for someone ;)
swedish slow-paced movie
user924016
sure @FélixGagnon-Grenier
18:09
@Sara I don't know Sara, i saw from some tutorial
@FélixGagnon-Grenier read the book, not going to spoil it by watching the movie.
How d'you like it @RonniSkansing?
there's a book? hmmm... the movie was quite good.
user924016
it was deep and good
the book must be pretty good I'd hazard
user924016
I guess, but yea the movie was really good
18:11
@happy - i hope so :) ;)
I do hope the earth keep turning too
0
A: How to use other languages in PHP echo or print

SaraWhy are you even calling json_encode()? The database clearly has a valid string in it, then you're encoding that into JSON, which yes... will turn non ascii characters into \uXXXX escape sequences. That's something you'd do if your consumer were Javascript code (or something else which speaks J...

never mind, just take the road and do what you like
@Sara - what does that means ? you need reputation sweet heart? :)
@TheGuy Nah. Just putting it somewhere he'll read it.
@TheGuy bad joke, you do are right however because I work at night
18:14
@Sara - i hope so btw ;)
@happy - i hope so ; :/
@TheGuy Please don't.
@FélixGagnon-Grenier - doing what dude?
ahaa, i get it
Chatroom Don'ts - room-11.github.io/#dont_3
@TheGuy "sweet heart"
okay :D good point btw!
wow, i've got two hat too :)
18:28
@Sara Didn't got the output still :(
@Ganesh What sort of browser are you using?
chrome
@Ganesh Go here: whatsmyip.org/http-headers Enter your test URL, then paste the request/response headers it comes up with to pastebin or something
@Ganesh Okay, see on line 21, where it shows "Content-type" in the response. Notice that it doesn't include the charset?
...Is it possible you have error reporting turned off?
I'll bet that you're outputting the header after other content, but you're not seeing the error because you have them turned off
Also, this: <metacharset="UTF-8"> isn't what they told you to add
spaces matter in SGML
<meta charset="UTF-8" />
Either this (done correctly), or my suggestion of the header() line (placed before other output) will fix your content.
18:47
i'll
Sara, i am very very new to php. You guys just saying me to add these code and that code. I am doing without knowing the syntax. I just started doing this just before 2 hours. So only i am asking you guys to alter my code and paste in Answer
Which is exactly what we don't like to do. Even if we did, you still would have to paste it at the correct place. Why not try to actually understand what the advice is, not just paste it?
I actually tried all the codes they provided me which gave me errors.
Don't just try. Google what they are. What they do. What they are used for. Google what a character encoding is.
I tried to do my best to do everything i can. Then at the worst case only i am asking you to do that copy paste work.
joking aside, even if we were to write it down (which is pretty much done in the asnwers) you still have to paste it at the right place. Which we can't do for you.
18:57
You know what, i opened around 15 tabs in my browser now and tried many codes .....

$mysqli->set_charset('utf8mb4'); // object oriented style
mysqli_set_charset($link, 'utf8mb4');
$dbh = new PDO('mysql:charset=utf8mb4');
print htmlentities($row['quote'], ENT_QUOTES, 'UTF-8');
header('Content-Type: application/json; charset=utf-8');
header('Content-Type:text/html; charset=UTF-8');
What does the word "before" mean to you?
Man... you just paste it in my answer. I have only two files there. And you are going to paste 4 lines of code . Actually that's the whole code of the file. That's what i am asking you guys
user924016
what is it, homework?
You seem to define it as "entitled", which I don't think is the right answer.
Ronni it is not homework i am trying to learn .. thatsall
18:58
Checks Mirriam-Webster
I am creating android application.. trying to connect it with php and mysql
user924016
user924016
btw you should reread the answers to your question
i'll do
user924016
can you see from the paste I gave you that json_encode encodes the chars?
user924016
19:08
and that is the reason why you are getting that output. Sara really asks a good question as to why you are using json_encode on the string?
My
Php version is 5.5.26
yes i saw
Yeah... but when i print without json_encode.. the output was தமிழà instead of தமிழ்
Yaaayyyyyy finally i got the answer
header('Content-Type: application/json; charset=UTF-8');
print json_encode($data, JSON_UNESCAPED_UNICODE); This did the trick for me.. :D
user924016
it's only the header line that did it
user924016
try making a file with just this
Noo
print json_encode($data, JSON_UNESCAPED_UNICODE); this also did
user924016
<?php
header('Content-Type:text/html; charset=UTF-8');
echo 'தமிழ்';
19:18
when i use it without JSON_UNESCAPED_UNICODE it is not coming
when i used that line too,, its coming
No ronni... I tried with header alone.. but didn't got output.. but when i used "print json_encode($data, JSON_UNESCAPED_UNICODE);" along with the header.. gave me the output
Anyway Ronni.. thanks to you tooo
Because you only said me to reread the answers.. I was in big tension. But after you said to reread..i did tat and i got the output.. Thanks a lottttttttttt
Please reopen this question, there is a very good solution to this
19:34
@DaveChen done
thank you so much
aw I lost my draft, time to type it up again :(
It turns out that making clocks is a lot of work: youtube.com/watch?v=XkJJid3_bhg
Hello I am trying to bind some parametters to a mysqli request and i get the following error message
Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given
This is what i did to get that error $stmt = mysqli_prepare($connection, "SELECT * FROM items WHERE id > ? last_id ORDER BY id ASC LIMIT 0, ?");

/* bind parameters for markers */
mysqli_stmt_bind_param($stmt, $last_id, $limit);
there should be LIMIT 1 i think...
The fact is that i am trying to bind parametter and I want the bound parametter to each time replace the other one. I am doing a loading on scroll
this is the original code in pdo which i want to convert into a procedural
try {
$sql = 'SELECT * FROM items WHERE id > :last_id ORDER BY id ASC LIMIT 0, :limit';
$query = $pdo->prepare($sql);
$query->bindParam(':last_id', $last_id, PDO::PARAM_INT);
$query->bindParam(':limit', $limit, PDO::PARAM_INT);
$query->execute();
$list = $query->fetchAll();
} catch (PDOException $e) {
echo 'PDOException : '. $e->getMessage();
}
19:41
anyone got a tutorial link on how to begin joomla template dev coming from laravel nd wordpress
So for the binding of parametter i get an error
if i put in limit 1
@ManOfGod Did you try googling the error message and looking at any of the first thousand results? like so
Also you appear to have borked up the function call:
mysqli_stmt_bind_param ( mysqli_stmt $stmt , string $types , mixed &$var1 [, mixed )
The second param is meant to be the types for the variables....
Danack.. Are you the one who voted my question as duplicate..?
@Danack Thanks
whats the difference between menus and modules in joomla am having a hard time getting this ?
19:59
@Andrea Saw the tweet - Monday it is!
user924016
oh yes!
user924016
Frydai incoming!
right on. office partys incoming too
20:43
Yo @NikiC, thanks to your AST I think we might be able to finally fix -0 and -0x80000000(00000000) :)
If I have this $_POST['array'] and I'm using a for loop to go through it, is the best way to get the values out $_POST['array'][$i]['key']?
I have no problem doing it like that, was just wondering if there was a better way I should be doing it.
@Waxi a foreach loop?
@Danack Just a regular for loop, for ($i = 0; $i <= count($_POST['array']); $i++)
A foreach loop, is my answer.
Ah, I forgot about the foreach...thank you sir.
20:51
Hey guys
I have a multidimensional array, how would the foreach work in that case?
foreach ($array as $key1 => $value1) {
    if (is_array($value2)) {
        foreach ($value1 as $key2 => $value2) {
        }
    }
    else {
        //It's a non-array value
    }
}
Ah so I nest 2 different foreach's. I see, thank you.
foreach ($_POST['allJobs'] as $key1 => $value1) {

    foreach ($value1 as $key2 => $value2) {

		$empNum = $_POST[$key1][$key2]['empNum'];

    }

};




for ($i = 0; $i <= count($_POST['allJobs']); $i++) {

	$empNum = $_POST['allJobs'][$i]['empNum'];

};
Sorry for being a php noob, but the bottom one is what I have, I don't understand how the top one needs to be.
21:06
Ugh, I want to fix the unary minus zero bug
I'm gonna have to make things slow :(
Abe
Abe
what bug is that?
@Waxi either step through it with a debugger, or use var_dump() to see what the values are, and then go from there...
@Abe -0.0 doesn't give negative zero
Abe
Abe
why is that important? IEEE rules or smt?
floats have negative zero, yes, and it's ridiculous that -0.0 doesn't work
also, it can introduce error
21:11
Math is not my strong suit, but how does -0 make any sense?
Abe
Abe
but why is important having it?
@Danack Yeah ok...will do.
Anyone here submitting to talk at midwest php next year?
@Abe because otherwise it makes floating-point arithmetic a pain?
Abe
Abe
@Andrea no clue :B
but i slightly remember an article explaining why js has two float zero
17
A: Uses for negative zero floating point value?

NPEFrom Wikipedia: It is claimed that the inclusion of signed zero in IEEE 754 makes it much easier to achieve numerical accuracy in some critical problems[1], in particular when computing with complex elementary functions[2]. The first reference is "Branch Cuts for Complex Elementary Function...

that explains it
21:15
44
Q: Are +0 and -0 the same?

RandomblueReading through the ECMAScript 5.1 specification, +0 and -0 are distinguished. Why then does +0 === -0 evaluate to true?

Abe
Abe
how about bc though? will be a change to cast to string etc?
@Abe no
we already support negative zero
the problem is that -0.0 doesn't behave correctly
user924016
-0-!-0
Abe
Abe
@Andrea oh i see
@Abe A better question; why does it have floats, rather than fixed point math?
21:17
@Danack simpler
having one numeric datatype simplifies things
In which sense of the word?
less complexity
don't have to worry about interactions between different number types (this is why Java only has signed ints)
I need to brush up my understanding of fixed and floating otherwise this -0 will continue to blow my mind.
fixed point maths in simpler than floating point to me......there's no weird x + 0.5 = x shenanigans.
@Danack what do you mean by fixed point? decimal?
21:23
@Andrea This looks like one for you reddit.com/r/PHP/comments/3x9d9v/…
I fell into the rabbit hole of fixed vs floating.
@NikiC it looks like one for @LeviMorrison I'd say
he can better explain the problems he faced than I can :)
I left a comment anyway
$ sapi/cli/php -r 'var_dump(-0.0);'
float(-0)
IT WORKS!
Abe
Abe
congrats!
ship it! :D
@NikiC Would making a version of ZEND_SUB with the first operand being UNUSED be a valid way of handling unary minus?
oh, wait, ABI compat. hmm
21:27
maybe I can stick something in extended_value
@Andrea We still have about 80 usable opcodes ^^
@NikiC I probably can't add a new one in a micro, can I? :p
You could also convert to -1* instead. Though it'll be slower than 0-
Abe
Abe
is andrea doing that with do_operation or scalars have different "handlers"?
@Andrea the article I was looking for seems to have fallen off the internet. But basically a Q48.16 would be better than floats for 'most' PHP apps. It's simpler in that values in the supported range behave reasonably uniformly across all of the value range, which doesn't happen with floats, as I'm sure you're aware,
but the way that floats fail just keeps catching people out. randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float
21:33
@Danack I'd like to add operator overloading as a way of addressing PHP's poverty of number types
> "You have a problem and think, 'I know! I'll use operator overloading!' Now you have two problems." - Jamie Zawinski
operator overloading is fine if you don't implement it the godawful way C++ did :)
wasn't that also/originally with regexes?
@FélixGagnon-Grenier that's what it originally said IIRC but it has been appropriated many times :)
it's a quite witty pun, I thoroughly agree with it being reused many many times :)
21:37
I'm not sure 'pun' is the right word
Me neither. I'm not that good at rightly coining expressions...
@Andrea technically it wouldn't break ABI, but I still wouldn't do it
@bwoebi yeah, I'm gonna do some bullshit with ZEND_SUB :)
if (OP1_TYPE == IS_CONST && UNEXPECTED(opline->extended_value == ZEND_AST_UNARY_MINUS)) {
… wtf?
you're not really going to do big bullshit with fixing these ±0.0
@anybody if you have a minute and are proficient with abstracting things, is my answer really that bad? I mean, it's not perfect, probably not even good, but I wonder if the downvote is only out of spite or because I really am giving bad advice stackoverflow.com/a/34137779/576767
21:40
I will if I can get away with it
I can't seem to close issues on bugs.php.net... It says my password is incorrect, and yet I've just used the same password to login. Any ideas anyone? Do I have the correct karma? (people.php.net/user.php?username=tpunt)
@Andrea also, you may want to swap a ZEND_SUB with negative ZEND_ADD…
@tpunt I failed on this hurdle by including my email in my username rather than just the part before the @
@bwoebi that doesn't help
I want $x = 0.0; $x = -$x; to work
so, why are you manipulating the IS_CONST case then?
21:43
@bwoebi unary minus compiles to 0 - $x
There's no point running this check for, say, CV op1 :p
ah, I see…
though, aren't we now going to have semantics differing from C then?
we currently do because 0 - x is not the same as -x
ah, well
@Danack I got past that hurdle :) I'm logged in, I just can't edit a bug report to close it. I've tried changing my password and logging out/then back in, but it keeps saying my password is incorrect when I try to edit a bug report.
@tpunt use the develop tab?
The edit tab is for the original reporter?
21:47
Whoops, my bad... Thanks @Danack
$ sapi/cli/php -r '$x = 0.0; var_dump(-$x);'
float(1.4054185352242E+14)
\o/
shit :p
Hello?
Is it me you're looking for?
21:50
Does anyone know if $a[count($a)-1] is equalivent to end($a)?
oh shit clang is smart, it realised that due to my goto a var would be uninitialised
@Andrea "For large values of zero"
@Murplyx No it isn't. A PHP array can have a different order to the indexes
@Murplyx No - $a['banana'] = 1;
21:51
@Andrea I have a suggestion… try parsing -$x as -0.0 - $x
Also, even if it has, say, 10 items, there's no guarantee the tenth is at index 9
@bwoebi I thought of that too, but that breaks integers
well if the $a was created like this: $a = file($filename);
Is it then equal?
@Murplyx I think file() gives you an array with integer keys in order that have no gaps, so yes
@Andrea because casting? well… can't we just use one's complement integers here? :-D
Why do you ask, though
21:52
$lines = file($filename);

if (!empty($lines)) {
$lines = array_slice($lines, -1 * ($max_lines - 1));

$lines[count($lines) - 1] = trim($lines[count($lines) - 1]) . "\r\n";
}
@Murplyx maybe? Why don't you try it and see if it works?
@bwoebi 64-bit ints don't always fit into floats
I am making a script that limits the amount of lines in a text file
@Andrea Why does multiplying by -1 not work?
@Andrea ah…
@NikiC good point…
21:53
@NikiC oh, wait, I understand what you're suggesting now
@Murplyx I'd normally use php.net/manual/en/function.fgets.php for that. Just read lines until you've read enough. It avoids reading all of the file in, if it's going to be discarded anyway.
That would fix it
$lines[count($lines) - 1] can be replaced with end($lines)
?
52 secs ago, by Danack
@Murplyx I'd normally use http://php.net/manual/en/function.fgets.php for that. Just read lines until you've read enough. It avoids reading all of the file in, if it's going to be discarded anyway.
@Murplyx not precisely
21:54
Why not?
Don't try and mutate stuff into the 'correct' format, when you can just create stuff in the right format to begin with.
@Murplyx it will give you the final element, but it also moves the array position to the end. that probably doesn't matter
@NikiC Dmitry will cry because a multiplication is a bit slower than add/sub (in terms of absolute cycles)!!!
@bwoebi rip dmitry
:-D
22:05
var_dump(-.0); // half-awake face
@NikiC since this is just an innocuous bug fix, think I could commit it directly to PHP-7.0?
then wait for dmitry to gasp :p
@Andrea yes.
22:24
Hey wait, I should fix this in 5.6 too
ugh
PHP 5...
@Andrea you shouldn't
@NikiC more chance of BC issues?
or I don't know, maybe
@NikiC generic fixes which go into 7 should go into 5.6 too (at least as long as the bug exists in 5.6 too ;-))
At least in part because the ratio of people writing new code that can take advantage of it against the number for who it would just be a subtle change is bad on 5.6 and much better on 7.
@bwoebi Is it a bug, or just a badly designed feature?
22:29
bug
@Danack bug
-0.0 should be negative zero, it's the only reasonable thing to do
(float)"-0.0" and -0.0 really shouldn't behave differently
Where does it say that we support negative zero?
principle of least astonishment etc.
@Danack we have floats
floats have negative zero, it's a thing
"principle of least astonishment"...which would be to not change it in PHP 5.6
22:30
@Danack it's a bug
I usually only do segfault fixes for 5.6
@Andrea Seriously, please give me an estimate of how many people who are going to be continue using PHP 5.6 would want to have this changed, vs the number of people for whom this could be a BC breaking surprise.
Also....even if it's a bug, it should be done in a minor version probably....
@Danack it would be unlikely to be a significant BC break
remember that -0.0 === 0.0
And it's more unlikely to be a desired fix for anyone who is stuck on 5.6.
I can't be bothered porting it to 5.x
and it's more useful in 7, because 1/0
so...
I'll merge it into PHP-7.0
/me goes to close bug on bugs.php.net

> bug is already closed

oh, thank you git hooks for spotting my commit :)
The bug fix is in PHP-7.0 and master.
now, we await the screams from Moscow
22:45
^^
he's sleeping ^^
let's benchmark, why not
… wrong chat.

« first day (1888 days earlier)      last day (3285 days later) »