subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
lolphp | SirClueless | cexgxwd | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 13 |
lolphp | _vec_ | cexiscu | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 11 |
lolphp | phoshi | cexlcpu | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 9 |
lolphp | imperfect_stars | cexb59f | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 8 |
lolphp | kasnalin | cexd5rc | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 8 |
lolphp | HelloAnnyong | cf038pj | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|> $x = 1;
$y = 1.1;
or some combination like that, because [float keys are converted to ints](http://us1.php.net/manual/en/language.types.array.php). Whee, php<|eor|><|sor|>Floats being converted to integers does actually... | 8 |
lolphp | poizan42 | cf0bwfl | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|> $x = 1;
$y = 1.1;
or some combination like that, because [float keys are converted to ints](http://us1.php.net/manual/en/language.types.array.php). Whee, php<|eor|><|sor|>Floats being converted to integers does actually... | 8 |
lolphp | ahruss | cexg40r | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 7 |
lolphp | FireyFly | cexww85 | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 7 |
lolphp | poizan42 | cf0fnaq | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Floats being converted to integers does actually make some kind of sense here. Saves you flooring it first.<|eor|><|sor|>But does it make more sense than allowing float keys, or converting the key to a string instead of an int?<... | 7 |
lolphp | poizan42 | cf0bz0f | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 6 |
lolphp | HelloAnnyong | cf02f38 | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|> $x = 1;
$y = 1.1;
or some combination like that, because [float keys are converted to ints](http://us1.php.net/manual/en/language.types.array.php). Whee, php<|eor|><|sor|>Floats being converted to integers does actually... | 6 |
lolphp | adambrenecki | cexh85g | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 5 |
lolphp | FireyFly | cexwt5e | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Reminds me of a similar puzzle! This was originally for JavaScript, which is almost as sad a language as PHP.
var x = ????;
var y = ????;
x === y; // true
1/x === 1/y; // false
Edit:
isNaN(x) === f... | 5 |
lolphp | Frimsah | cf93uij | <|sols|><|sot|>Fill in the blanks!<|eot|><|sol|>http://i.imgur.com/Wtg4OQZ.png<|eol|><|sor|>Floats being converted to integers does actually make some kind of sense here. Saves you flooring it first.<|eor|><|sor|>But does it make more sense than allowing float keys, or converting the key to a string instead of an int?<... | 5 |
lolphp | SquireCD | l5z3k3 | <|sols|><|sot|>Good news but also lol<|eot|><|sol|>/r/PHP/comments/l5f4l7/the_tide_has_turned_php_manual_started_to_promote/<|eol|><|eols|><|endoftext|> | 52 |
lolphp | elcapitanoooo | gkxpflg | <|sols|><|sot|>Good news but also lol<|eot|><|sol|>/r/PHP/comments/l5f4l7/the_tide_has_turned_php_manual_started_to_promote/<|eol|><|sor|>The way PHP handles errors are appalling by all standards. Im not a fan of exceptions in the first place (because many misuse them as a control flow primitive), but in PHP its even w... | 13 |
lolphp | elcapitanoooo | gkxji6e | <|sols|><|sot|>Good news but also lol<|eot|><|sol|>/r/PHP/comments/l5f4l7/the_tide_has_turned_php_manual_started_to_promote/<|eol|><|sor|>The way PHP handles errors are appalling by all standards. Im not a fan of exceptions in the first place (because many misuse them as a control flow primitive), but in PHP its even w... | 12 |
lolphp | kksnicoh | gkxj9tw | <|sols|><|sot|>Good news but also lol<|eot|><|sol|>/r/PHP/comments/l5f4l7/the_tide_has_turned_php_manual_started_to_promote/<|eol|><|sor|>oh yea, PDO library error mode configuration makes the semantical behavior of the program completely different / useless.
but congratz on moving onto the future 2010<|eor|><|eols|><... | 11 |
lolphp | colshrapnel | gkxlq6e | <|sols|><|sot|>Good news but also lol<|eot|><|sol|>/r/PHP/comments/l5f4l7/the_tide_has_turned_php_manual_started_to_promote/<|eol|><|sor|>The way PHP handles errors are appalling by all standards. Im not a fan of exceptions in the first place (because many misuse them as a control flow primitive), but in PHP its even w... | 6 |
lolphp | shared-media | bfzpjp | <|sols|><|sot|>Thanks google news, we need more PHP topics<|eot|><|sol|>https://i.redd.it/qf3jywqc2st21.jpg<|eol|><|eols|><|endoftext|> | 51 |
lolphp | squiggleslash | elhql8r | <|sols|><|sot|>Thanks google news, we need more PHP topics<|eot|><|sol|>https://i.redd.it/qf3jywqc2st21.jpg<|eol|><|sor|>I'm surprised the list didn't also include 0, "0", false, "", and null.<|eor|><|eols|><|endoftext|> | 11 |
lolphp | dotancohen | elhhk3w | <|sols|><|sot|>Thanks google news, we need more PHP topics<|eot|><|sol|>https://i.redd.it/qf3jywqc2st21.jpg<|eol|><|sor|>This is a lolgoogle, it has nothing to do with PHP.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | pilif | 787til | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|eols|><|endoftext|> | 51 |
lolphp | SirClueless | dos7irn | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>OK, so this is all documented incredibly poorly, and `escape_char` is not doing at all what you think it's doing. All it is doing is **searching the input string** for this character and printing this character and the one fo... | 54 |
lolphp | pilif | dosba1h | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>OK, so this is all documented incredibly poorly, and `escape_char` is not doing at all what you think it's doing. All it is doing is **searching the input string** for this character and printing this character and the one fo... | 20 |
lolphp | SirClueless | dosc0lf | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>OK, so this is all documented incredibly poorly, and `escape_char` is not doing at all what you think it's doing. All it is doing is **searching the input string** for this character and printing this character and the one fo... | 7 |
lolphp | yawkat | dorsr9l | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>And knowing csv, this is probably valid in some obscure csv dialect.
Still pretty fucked up though.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | nyamsprod | dot65q5 | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>OK, so this is all documented incredibly poorly, and `escape_char` is not doing at all what you think it's doing. All it is doing is **searching the input string** for this character and printing this character and the one fo... | 6 |
lolphp | pilif | dors052 | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>Two questions:
1. Why is the first column getting enclosed when it doesn't need to be?
2. Aren't single quotes supposed to not evaluate escape sequences? What I mean is, shouldn't the last line start with: using \\\\ ...<|e... | 5 |
lolphp | SirClueless | dotlw0x | <|sols|><|sot|>Go home fputcsv() you're drunk<|eot|><|sol|>https://3v4l.org/LKkfW<|eol|><|sor|>OK, so this is all documented incredibly poorly, and `escape_char` is not doing at all what you think it's doing. All it is doing is **searching the input string** for this character and printing this character and the one fo... | 5 |
lolphp | jesseschalken | 5htz6l | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|eols|><|endoftext|> | 51 |
lolphp | sproingie | db30kfi | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|sor|>PHP's confused array implementation strikes again. It is worth noting that HHVM (and therefore Hack) gets it right.<|eor|><|eols|><|endoftext|> | 21 |
lolphp | the_alias_of_andrea | db3m5l0 | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|sor|>It's a known issue that I'd like to fix. At compile-time, `$foo["123"]` is rewritten to `$foo[123]`. This would be a completely safe and transparent optimisation... | 16 |
lolphp | the_alias_of_andrea | db3m6ld | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|sor|>PHP's confused array implementation strikes again. It is worth noting that HHVM (and therefore Hack) gets it right.<|eor|><|sor|>HHVM lacks this particular brok... | 9 |
lolphp | suspiciously_calm | db44e4v | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|sor|>*And of course* the behavior changes within a major version number.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | jesseschalken | db7k3ms | <|sols|><|sot|>Automatic string->int conversion for string literals, but not for variables containing strings<|eot|><|sol|>https://3v4l.org/id5OA<|eol|><|sor|>PHP's confused array implementation strikes again. It is worth noting that HHVM (and therefore Hack) gets it right.<|eor|><|sor|>HHVM lacks this particular brok... | 6 |
lolphp | Takeoded | 4msozr | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|eols|><|endoftext|> | 52 |
lolphp | Various_Pickles | d3yglbn | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|sor|>Now all it needs to do is:
* Only report errors in a way that's accessible via manually calling linkinfo_error()
* Read all of its associated internal state directly from (the first) php.... | 28 |
lolphp | nikic | d3ygmx9 | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|sor|>From a quick glance at the code this looks like a documentation error. It's either `false` or `-1`, but not `0`.<|eor|><|eols|><|endoftext|> | 15 |
lolphp | garagedragon | d3ygoxe | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|sor|>The downvotes on the comment are the icing on the cake.<|eor|><|eols|><|endoftext|> | 13 |
lolphp | squiggleslash | d3ytx29 | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|sor|>From a quick glance at the code this looks like a documentation error. It's either `false` or `-1`, but not `0`.<|eor|><|sor|>Maybe it should return "", or even better "0"...<|eor|><|eols|... | 10 |
lolphp | Deviltry1 | d3z8q59 | <|sols|><|sot|>linkinfo returns 0 or false or -1 for error<|eot|><|sol|>http://php.net/manual/en/function.linkinfo.php<|eol|><|sor|>From a quick glance at the code this looks like a documentation error. It's either `false` or `-1`, but not `0`.<|eor|><|sor|>Maybe it should return "", or even better "0"...<|eor|><|sor|>... | 6 |
lolphp | RainOnYourTirade | 4mame1 | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|eols|><|endoftext|> | 51 |
lolphp | RainOnYourTirade | d3tx5n7 | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 19 |
lolphp | duskwuff | d3tyxgr | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 15 |
lolphp | duskwuff | d3tzndw | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 13 |
lolphp | Danack | d3ubs9l | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 8 |
lolphp | RainOnYourTirade | d3tz4rd | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 8 |
lolphp | RainOnYourTirade | d3u09n6 | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 8 |
lolphp | Danack | d3ubobf | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|sor|>Imagick is much better than the GD library that PHP ships with by default for some reason. It is strange that it's so undocumented though.<|eor|><|sor|>> It is strange that it's so undocumented though.
Writ... | 7 |
lolphp | emilvikstrom | d3u390s | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|sor|>Imagick is much better than the GD library that PHP ships with by default for some reason. It is strange that it's so undocumented though.<|eor|><|eols|><|endoftext|> | 6 |
lolphp | Danack | d3ubvlm | <|sols|><|sot|>Oh boy, I wonder what this function does<|eot|><|sol|>http://i.imgur.com/RffXApG.jpg<|eol|><|soopr|>Actually, most of Imagick is pretty sparesly documented, with some functions going as far as to have the warning:
>This function is currently not documented; only its argument list is available.
Quality ... | 6 |
lolphp | iopq | 4eeklg | <|sols|><|sot|>When errors don't help<|eot|><|sol|>http://i.imgur.com/Uv2Wo3u.png<|eol|><|eols|><|endoftext|> | 48 |
lolphp | edwardly | d1zkbfu | <|sols|><|sot|>When errors don't help<|eot|><|sol|>http://i.imgur.com/Uv2Wo3u.png<|eol|><|sor|>It kinda looks like you tried to "type hint" to class `string`, attempting to hint the scalar type string - available in PHP7. Is that what happened here?
Assuming you saw this in the docs - http://php.net/manual/en/functio... | 15 |
lolphp | the_alias_of_andrea | d1zm26h | <|sols|><|sot|>When errors don't help<|eot|><|sol|>http://i.imgur.com/Uv2Wo3u.png<|eol|><|sor|>It's a slightly confusing error message, but what it means is you have a type declaration requiring an object that is an instance of a class named `string`, whereas what you've given it is a string, the basic type.<|eor|><|eo... | 15 |
lolphp | edwardly | d1zlmxh | <|sols|><|sot|>When errors don't help<|eot|><|sol|>http://i.imgur.com/Uv2Wo3u.png<|eol|><|sor|>It kinda looks like you tried to "type hint" to class `string`, attempting to hint the scalar type string - available in PHP7. Is that what happened here?
Assuming you saw this in the docs - http://php.net/manual/en/functio... | 13 |
lolphp | jacybear | d20cyhr | <|sols|><|sot|>When errors don't help<|eot|><|sol|>http://i.imgur.com/Uv2Wo3u.png<|eol|><|sor|>It's a slightly confusing error message, but what it means is you have a type declaration requiring an object that is an instance of a class named `string`, whereas what you've given it is a string, the basic type.<|eor|><|so... | 11 |
lolphp | poizan42 | 19s4rb | <|sols|><|sot|>Impossible to comment a line with a string out when it contains "?>" (x-post from r/programming)<|eot|><|sol|>http://stackoverflow.com/q/15219815/1288<|eol|><|eols|><|endoftext|> | 51 |
lolphp | farsightxr20 | c8qtcw7 | <|sols|><|sot|>Impossible to comment a line with a string out when it contains "?>" (x-post from r/programming)<|eot|><|sol|>http://stackoverflow.com/q/15219815/1288<|eol|><|sor|>By the looks of it, you _can_ use `/* ... */` to comment out a line containing a closing tag; it just so happened that OP also had `*/` in hi... | 15 |
lolphp | the_alias_of_andrea | 3vy6vf | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|eols|><|endoftext|> | 53 |
lolphp | Jonny_Axehandle | cxrwcip | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>Should be a sidebar item<|eor|><|eols|><|endoftext|> | 23 |
lolphp | the_alias_of_andrea | cxs5h9w | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>I wonder how many of these are no longer an issue in PHP7, seeing as how its compiler has been rewritten and uses an AST.<|eor|><|soopr|>The lexer hasn't been rewritten, the compiler has.
Anyway, the only parsing thing that no longer fully appl... | 16 |
lolphp | the_alias_of_andrea | cxrr9rd | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>I've got one too:
* mpty` doesn't work on function return values, but only on variables/array items
For example, this won't work:
if(empty(trim($x)) $blank = true;
> Fatal error: Can't use function return value in write context
Where... | 14 |
lolphp | bart2019 | cxrqtg8 | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>I've got one too:
* mpty` doesn't work on function return values, but only on variables/array items
For example, this won't work:
if(empty(trim($x)) $blank = true;
> Fatal error: Can't use function return value in write context
Where... | 13 |
lolphp | beerdude26 | cxsgkix | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>I've got one too:
* mpty` doesn't work on function return values, but only on variables/array items
For example, this won't work:
if(empty(trim($x)) $blank = true;
> Fatal error: Can't use function return value in write context
Where... | 11 |
lolphp | BilgeXA | cxs45jy | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>Not being able to override private members is a sadness? No, actually it is pretty standard.<|eor|><|sor|>Moreover, the author cites mocking as a reason for overriding private methods. I believe that calls into question the author's competency w... | 10 |
lolphp | Schmittfried | cxso4x6 | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>Not being able to override private members is a sadness? No, actually it is pretty standard.<|eor|><|sor|>Moreover, the author cites mocking as a reason for overriding private methods. I believe that calls into question the author's competency w... | 10 |
lolphp | Schmittfried | cxrww4y | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>Not being able to override private members is a sadness? No, actually it is pretty standard.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | coredumperror | cxs9das | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>Not being able to override private members is a sadness? No, actually it is pretty standard.<|eor|><|sor|>Moreover, the author cites mocking as a reason for overriding private methods. I believe that calls into question the author's competency w... | 8 |
lolphp | squiggleslash | cxvp4rf | <|sols|><|sot|>PHP Sadness<|eot|><|sol|>http://phpsadness.com<|eol|><|sor|>I've got one too:
* mpty` doesn't work on function return values, but only on variables/array items
For example, this won't work:
if(empty(trim($x)) $blank = true;
> Fatal error: Can't use function return value in write context
Where... | 6 |
lolphp | volnix | 2g3ziq | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|eols|><|endoftext|> | 53 |
lolphp | Muchoz | ckffu55 | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Better use === then.<|eor|><|eols|><|endoftext|> | 16 |
lolphp | iopq | ckfssjq | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Just because 0 == '0' doesn't mean that '0' == X where 0 == X
http://3v4l.org/7gslD<|eor|><|sor|>Unlike regular equality, php equality isn't transitive. `true == "php" == 0 == false... | 15 |
lolphp | raziel2p | ckff01b | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Just because 0 == '0' doesn't mean that '0' == X where 0 == X
http://3v4l.org/7gslD<|eor|><|eols|><|endoftext|> | 14 |
lolphp | iopq | ckfw94d | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Just because 0 == '0' doesn't mean that '0' == X where 0 == X
http://3v4l.org/7gslD<|eor|><|sor|>Unlike regular equality, php equality isn't transitive. `true == "php" == 0 == false... | 14 |
lolphp | PasswordIsntHAMSTER | ckfjqx8 | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Intransitive equality, so fucking stupid<|eor|><|eols|><|endoftext|> | 13 |
lolphp | ismtrn | ckfmwgh | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>>but only sometimes
No. `0 == '0'` is always true. You've used `in_array` to confuse the matter but you're comparing something totally different:
var_dump(0 == 'foo'); // true ... | 13 |
lolphp | iopq | ckfwxhv | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Just because 0 == '0' doesn't mean that '0' == X where 0 == X
http://3v4l.org/7gslD<|eor|><|sor|>Unlike regular equality, php equality isn't transitive. `true == "php" == 0 == false... | 9 |
lolphp | iopq | ckfxi1y | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Because it's a fast and easy way to compare straightforward data w/o the need of converting variables back and forth. No convert.ToDouble['variable'] or anything like that needed fir... | 9 |
lolphp | iopq | ckfsghk | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Better use === then.<|eor|><|sor|>Is this so hard for people to understand? Wow. Again and again, people freak out over ===.<|eor|><|sor|>because you have to do `in_array($a, $b, tru... | 8 |
lolphp | midir | ckfliab | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>>but only sometimes
No. `0 == '0'` is always true. You've used `in_array` to confuse the matter but you're comparing something totally different:
var_dump(0 == 'foo'); // true ... | 6 |
lolphp | catcradle5 | ckfw2xk | <|sols|><|sot|>I'm a PHP fan, but this still blows my mind. 0 == '0', but only sometimes.<|eot|><|sol|>http://3v4l.org/BRUBg<|eol|><|sor|>Just because 0 == '0' doesn't mean that '0' == X where 0 == X
http://3v4l.org/7gslD<|eor|><|sor|>Unlike regular equality, php equality isn't transitive. `true == "php" == 0 == false... | 5 |
lolphp | Porges | 2dkfw4 | <|sols|><|sot|>All right, which one of you is this?<|eot|><|sol|>https://twitter.com/jakedonham/status/499983826638995458<|eol|><|eols|><|endoftext|> | 52 |
lolphp | fred_emmott | cjqgqkh | <|sols|><|sot|>All right, which one of you is this?<|eot|><|sol|>https://twitter.com/jakedonham/status/499983826638995458<|eol|><|sor|>Proof: http://cl.ly/image/0k2b0l1Y2c0Z<|eor|><|eols|><|endoftext|> | 66 |
lolphp | joepie91 | 1twal5 | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|eols|><|endoftext|> | 50 |
lolphp | duskwuff | cec5jfp | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>Working as (confusingly) designed.
`$obj->func` and `$obj->func()` do not reference the same thing. The first one is referring to an instance variable of `$obj`, and the second one is calling a method on the class of `$obj`. While... | 33 |
lolphp | Lokaltog | cec2i1n | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>A fractal of bad design indeed.<|eor|><|eols|><|endoftext|> | 22 |
lolphp | user0x29a | cecfp9o | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>Working as (confusingly) designed.
`$obj->func` and `$obj->func()` do not reference the same thing. The first one is referring to an instance variable of `$obj`, and the second one is calling a method on the class of `$obj`. While... | 19 |
lolphp | joepie91 | cecgy4j | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>> $this->func contains a Closure (ie. anonymous function).
A closure is a function which keeps references to it's enclosing scope, the word you might be looking for is lambda.<|eor|><|soopr|>I'm not saying that the term "closure" ... | 11 |
lolphp | boxingdog | cec7hi2 | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>$this->func() != $this->func<|eor|><|eols|><|endoftext|> | 10 |
lolphp | joepie91 | cec4wkw | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>So, you have to define it first... <|eor|><|soopr|>In both cases, $this->func refers to the same "closure". In the latter case, it is assigned to a local variable before calling it; in the former, it is called directly as a member... | 9 |
lolphp | himdel | ceclveu | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>Working as (confusingly) designed.
`$obj->func` and `$obj->func()` do not reference the same thing. The first one is referring to an instance variable of `$obj`, and the second one is calling a method on the class of `$obj`. While... | 8 |
lolphp | joepie91 | cecgyz5 | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>Working as (confusingly) designed.
`$obj->func` and `$obj->func()` do not reference the same thing. The first one is referring to an instance variable of `$obj`, and the second one is calling a method on the class of `$obj`. While... | 7 |
lolphp | djsumdog | cedr9ye | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>reminds me...
$this->class_string::meth();
fails, instead must
$class = $this->class_string;
$class::meth();<|eor|><|sor|>Yep. You can't chain together function calls. It annoyed me years ago when I couldn't do $f... | 6 |
lolphp | dagbrown | cecgt7h | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>$this->func() != $this->func<|eor|><|sor|> $this->func() != $this->func != $func=$this->func;$func();
My poor head.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | oridb | cemgro7 | <|sols|><|sot|>Really, PHP? Really?<|eot|><|sol|>http://sprunge.us/CaQX?php<|eol|><|sor|>Working as (confusingly) designed.
`$obj->func` and `$obj->func()` do not reference the same thing. The first one is referring to an instance variable of `$obj`, and the second one is calling a method on the class of `$obj`. While... | 5 |
lolphp | Serialk | 1rxey4 | <|soss|><|sot|>Some useful functions from the PHP standard library<|eot|><|sost|>* http://www.php.net/manual/en/function.jewishtojd.php
* http://www.php.net/manual/en/function.easter-date.php
* http://www.php.net/manual/en/function.easter-days.php
<|eost|><|eoss|><|endoftext|> | 49 |
lolphp | scshunt | cdrvtku | <|soss|><|sot|>Some useful functions from the PHP standard library<|eot|><|sost|>* http://www.php.net/manual/en/function.jewishtojd.php
* http://www.php.net/manual/en/function.easter-date.php
* http://www.php.net/manual/en/function.easter-days.php
<|eost|><|sor|>The easter functions assume that the vernal equinox is on... | 38 |
lolphp | phoshi | cds033t | <|soss|><|sot|>Some useful functions from the PHP standard library<|eot|><|sost|>* http://www.php.net/manual/en/function.jewishtojd.php
* http://www.php.net/manual/en/function.easter-date.php
* http://www.php.net/manual/en/function.easter-days.php
<|eost|><|sor|>As an aside, I just love the consistent naming...
* JDTo... | 30 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.