subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
lolphp | Banane9 | cms389p | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>Heh "won't fix". Essentially because fixing it would be hard. <|eor|><|sor|>And the proposed solution: create an .ini setting.
Pure gold.<|eor|><|sor|>Even better that the .ini s... | 8 |
lolphp | stesch | cmspz4x | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>For comparison:
keith@Keiths-Hackintosh ~ $ irb
2.0.0-p247 :001 > (1234.56.to_s).to_f == 1234.56
=> true
<|eor|><|sor|>Hm, what happens if you change the locale? <|e... | 8 |
lolphp | frezik | cmxwkk7 | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>Heh "won't fix". Essentially because fixing it would be hard. <|eor|><|sor|>It's not because it'd be hard, it's because inevitably a lot of people rely on this and you'd break the... | 6 |
lolphp | allthediamonds | cms5z89 | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>Please, PHP, just stop trying. Save yourself further embarrassment.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | ZiggyTheHamster | cms684l | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>For comparison:
keith@Keiths-Hackintosh ~ $ irb
2.0.0-p247 :001 > (1234.56.to_s).to_f == 1234.56
=> true
<|eor|><|eols|><|endoftext|> | 5 |
lolphp | ZiggyTheHamster | cms78k9 | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>For comparison:
keith@Keiths-Hackintosh ~ $ irb
2.0.0-p247 :001 > (1234.56.to_s).to_f == 1234.56
=> true
<|eor|><|sor|>Hm, what happens if you change the locale? <|e... | 5 |
lolphp | jamieflournoy | cmtbc1s | <|sols|><|sot|>PHP :: Bug #53711 :: Casting float->string->float with locale<|eot|><|sol|>https://bugs.php.net/bug.php?id=53711<|eol|><|sor|>For comparison:
keith@Keiths-Hackintosh ~ $ irb
2.0.0-p247 :001 > (1234.56.to_s).to_f == 1234.56
=> true
<|eor|><|sor|>Hm, what happens if you change the locale? <|e... | 5 |
lolphp | immibis | 272twb | <|sols|><|sot|>In PHP, 0 + 2 is 2, but 0+2 is 4<|eot|><|sol|>https://bugs.php.net/bug.php?id=61095<|eol|><|eols|><|endoftext|> | 54 |
lolphp | poizan42 | chx26au | <|sols|><|sot|>In PHP, 0 + 2 is 2, but 0+2 is 4<|eot|><|sol|>https://bugs.php.net/bug.php?id=61095<|eol|><|sor|>Wow, a bug that got fixed a few years ago! Who would have thought that software has bugs?<|eor|><|sor|>If you had ever written a compiler you would know that a bug such as this would take some serious effort ... | 21 |
lolphp | dehrmann | chx0czy | <|sols|><|sot|>In PHP, 0 + 2 is 2, but 0+2 is 4<|eot|><|sol|>https://bugs.php.net/bug.php?id=61095<|eol|><|sor|>Pretty sure 90% of the class got this right in my compilers course.<|eor|><|eols|><|endoftext|> | 14 |
lolphp | callcifer | 1zk0y4 | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|eols|><|endoftext|> | 53 |
lolphp | lisp-case | cfube6c | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>It's tripping over the "numeric string" condition. Because for *some reason* PHP decided that when you compare two strings that look like numbers, they will both be converted to floats and then co... | 38 |
lolphp | ThisIsADogHello | cfuqam3 | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>I haven't written PHP in years (and hope I never have to again), but I believe the correct way of dealing with this is to use [strcmp](http://php.net/strcmp) instead of comparing strings with the ... | 22 |
lolphp | tdammers | cfuv1sp | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>[deleted]<|eor|><|sor|>It's not reasonable; it's what the people who made it were capable of implementing. Then PHP accidentally became popular, and before anyone realized there was a problem, the... | 20 |
lolphp | tdammers | cfud5io | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>[deleted]<|eor|><|sor|>It's not reasonable; it's what the people who made it were capable of implementing. Then PHP accidentally became popular, and before anyone realized there was a problem, the... | 17 |
lolphp | hervold | cfuh017 | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>[deleted]<|eor|><|sor|>I believe they aren't discarded. They are treated as an exponent in scientific floating point representation.
> var_dump('2e1' == '20');
bool(true)
<|eor|><|sor|>ri... | 14 |
lolphp | piciu | cfuu692 | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>I haven't written PHP in years (and hope I never have to again), but I believe the correct way of dealing with this is to use [strcmp](http://php.net/strcmp) instead of comparing strings with the ... | 11 |
lolphp | vytah | cfugtdh | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>[deleted]<|eor|><|sor|>I believe they aren't discarded. They are treated as an exponent in scientific floating point representation.
> var_dump('2e1' == '20');
bool(true)
<|eor|><|eols|><... | 8 |
lolphp | MachaHack | cfx1fpi | <|sols|><|sot|>Wait, what? How is this possible even with weak comparison?<|eot|><|sol|>https://eval.in/111886<|eol|><|sor|>And now I realise that something I wrote when I was 14 had even worse security issues than using unsalted md5 for passwords. I'm glad that never got deployed anywhere useful.<|eor|><|eols|><|endof... | 7 |
lolphp | Dereleased | 1fnt34 | <|soss|><|sot|>Weird properties of PHP's lexer and parser<|eot|><|sost|>There are (as of PHP 5.3.0) only two tokens which represent a single character:
* T_NAMESPACE_SEPARATOR: `\`
* T_CURLY_OPEN: `{`
* This only occurs inside of interpolated strings, e.g. "{$foo}" lexes to: `'"' T_CURLY_OPEN T_VARIABLE '}' '"'`
* ~... | 55 |
lolphp | olemartinorg | cac30fh | <|soss|><|sot|>Weird properties of PHP's lexer and parser<|eot|><|sost|>There are (as of PHP 5.3.0) only two tokens which represent a single character:
* T_NAMESPACE_SEPARATOR: `\`
* T_CURLY_OPEN: `{`
* This only occurs inside of interpolated strings, e.g. "{$foo}" lexes to: `'"' T_CURLY_OPEN T_VARIABLE '}' '"'`
* ~... | 12 |
lolphp | Dereleased | cac29u2 | <|soss|><|sot|>Weird properties of PHP's lexer and parser<|eot|><|sost|>There are (as of PHP 5.3.0) only two tokens which represent a single character:
* T_NAMESPACE_SEPARATOR: `\`
* T_CURLY_OPEN: `{`
* This only occurs inside of interpolated strings, e.g. "{$foo}" lexes to: `'"' T_CURLY_OPEN T_VARIABLE '}' '"'`
* ~... | 11 |
lolphp | dipswitch | cac3j67 | <|soss|><|sot|>Weird properties of PHP's lexer and parser<|eot|><|sost|>There are (as of PHP 5.3.0) only two tokens which represent a single character:
* T_NAMESPACE_SEPARATOR: `\`
* T_CURLY_OPEN: `{`
* This only occurs inside of interpolated strings, e.g. "{$foo}" lexes to: `'"' T_CURLY_OPEN T_VARIABLE '}' '"'`
* ~... | 8 |
lolphp | MilkshakeYeah | 1eieco | <|soss|><|sot|>is_a function change of heart<|eot|><|sost|>5.0.0 This function became deprecated in favour of the instanceof operator. Calling this function will result in an E_STRICT warning.
5.3.0 This function is no longer deprecated, and will therefore no longer throw E_STRICT warnings.
http://pl1.php.net/manua... | 52 |
lolphp | emarocca | 11im47 | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|eols|><|endoftext|> | 53 |
lolphp | chellomere | c6mw2bh | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|>Down in the comments you find this genius... | 14 |
lolphp | Rhomboid | c6mzya7 | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|>BUT WAIT THERE IS MORE
For some reason I... | 10 |
lolphp | Porges | c6n4mtl | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|> The integer value of var on success, ... | 9 |
lolphp | vytah | c6n51cb | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|> The integer value of var on success, ... | 7 |
lolphp | vytah | c6n4rg6 | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|>Jesus, these examples are ridiculous.
... | 7 |
lolphp | scshunt | c6mugrv | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|>But using it on an object is an error.<|e... | 5 |
lolphp | Rhomboid | c6mzvlf | <|sols|><|sot|>intval returns the integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. Very big values return 0. Strings will most likely return 0. Sometimes 1.<|eot|><|sol|>http://php.net/manual/en/function.intval.php<|eol|><|sor|>Down in the comments you find this genius... | 5 |
lolphp | ilikeboyswithglasses | 5jjvuc | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 54 |
lolphp | duskwuff | dbh0xcj | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 28 |
lolphp | sloat | dbha42o | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 22 |
lolphp | thenickdude | dbjasae | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 14 |
lolphp | SirClueless | dbhq4j1 | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 14 |
lolphp | SirClueless | dbhq8wj | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 11 |
lolphp | Plorkyeran | dbon4yi | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 11 |
lolphp | the_alias_of_andrea | dbhfc3r | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 8 |
lolphp | edave64 | dbhx92w | <|soss|><|sot|>assertEquals(x, y) always passes if x and y are MongoDB ObjectIDs<|eot|><|sost|>The following is a successfully passing PHPUnit test (PHP 7.0.9, PHPUnit 5.7.4):
use MongoDB\BSON\ObjectID;
class ObjectIDGenerationTest extends \PHPUnit_Framework_TestCase {
function testObjectIDCompari... | 8 |
lolphp | theinvsblman | 3mg5kx | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 56 |
lolphp | bart2019 | cveotaw | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 26 |
lolphp | theinvsblman | cveptme | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 21 |
lolphp | bart2019 | cvhy08d | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 10 |
lolphp | theinvsblman | cvf1oat | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 10 |
lolphp | headzoo | cveya9p | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 9 |
lolphp | theinvsblman | cvewnnx | <|soss|><|sot|>PHP's stat can actually be very expensive<|eot|><|sost|>Calling stat() on a path that contains many dots and double dots makes PHP perform an enormous amount of syscalls. Here's an [example PHP program](http://pastebin.com/KLPXb8jk) and its [strace output](https://gist.github.com/enneract/6a337c57dab6e8a... | 6 |
lolphp | barubary | 3llzd7 | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|eols|><|endoftext|> | 49 |
lolphp | satan-repents | cv7l3rr | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|sor|>> PHP manual also say Operator precedence and associativity only determine how expressions are grouped, they... | 24 |
lolphp | nikic | cv7u5zl | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|sor|>> PHP manual also say Operator precedence and associativity only determine how expressions are grouped, they... | 16 |
lolphp | barubary | cv7pl8i | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|sor|>> PHP manual also say Operator precedence and associativity only determine how expressions are grouped, they... | 15 |
lolphp | edvo | cv7w328 | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|sor|>> PHP manual also say Operator precedence and associativity only determine how expressions are grouped, they... | 7 |
lolphp | barubary | cvl12ya | <|sols|><|sot|>Assignment operator doesn't follow its own precedence rules<|eot|><|sol|>http://stackoverflow.com/questions/32672016/js-vs-php-assignment-operator-precedence-when-used-with-logical-or<|eol|><|sor|>> $a || $a = 1;
Why would you ever write something like this? The OP even says "I use this all the time".<|... | 5 |
lolphp | Rican7 | 247u3e | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|eoss|><|endoftext|> | 53 |
lolphp | deadstone | ch4hf6n | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|eoss|><|endoftext|> | 45 |
lolphp | ajmarks | ch4kteb | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>de_serialize_real() with some flags that make it dump variables into the n... | 38 |
lolphp | ZorbaTHut | ch4pg0i | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>de_serialize_real() with some flags that make it dump variables into the n... | 38 |
lolphp | YouAintGotToLieCraig | ch4t1ut | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>That's my favorite Counter-Strike map.<|eor|><|eoss|><|endoftext|> | 33 |
lolphp | catcradle5 | ch4k1kf | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>serialize_de(
not to be confused with serialize_de_de because _de doesnt ... | 24 |
lolphp | catcradle5 | ch4kcna | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 17 |
lolphp | ZorbaTHut | ch4pgm5 | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 17 |
lolphp | kageurufu | ch4jawj | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>serialize_de(
not to be confused with serialize_de_de because _de doesnt ... | 16 |
lolphp | frezik | ch554ks | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>de_serialize_real() with some flags that make it dump variables into the n... | 16 |
lolphp | kenlubin | ch4mqm2 | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>deserialize is grammatically valid (similar to decipher or decode), but unserialize is also grammatically valid (similar to undo or python's unpickle).<|eor|... | 15 |
lolphp | suspiciously_calm | ch4wyeq | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>That's my favorite Counter-Strike map.<|eor|><|sor|>The bomb has been plan... | 15 |
lolphp | suspiciously_calm | ch4wyzg | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>That's unpossible!<|eor|><|eoss|><|endoftext|> | 11 |
lolphp | lisp-case | ch5603c | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 9 |
lolphp | kenlubin | ch4ry6y | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 8 |
lolphp | poloppoyop | ch5uznp | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 7 |
lolphp | Astr4c | ch6s7a1 | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>There's no real reason to use it over JSON (which uses json_encode and json_decode). JSON is faster in modern PHP versions, it's much easier to read, and the... | 6 |
lolphp | hylje | ch5sagq | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>PHP needs a grammar/namespace fixing pass.
Take all the fucked up and inconsistent grammar and naming conventions in the php core, and fix it.
Alias the wr... | 6 |
lolphp | kageurufu | ch4k8xv | <|soss|><|sot|> Dear god. Today I just realized that #php's `unserialize()` is grammatically incorrect. It should be `deserialize()`.<|eot|><|sost|><|eost|><|sor|>Knowing PHP, if they changed it, it would probably be de_Serialise().<|eor|><|sor|>serialize_de(
not to be confused with serialize_de_de because _de doesnt ... | 6 |
lolphp | n1c0_ds | 1zpxkl | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|eols|><|endoftext|> | 53 |
lolphp | zeus_is_back | cfvynad | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>PHP has 10,000+ loose functions built in, but you still have to roll your own for even the most basic things.<|eor|><|eols|><|endoftext|> | 31 |
lolphp | PhantomRacer | cfw8kq6 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>> These functions will return false for a string, even if it contains an integer.
Strings can't contain integers, they can only contains strings of characters. PHP's loose typi... | 22 |
lolphp | senatorpjt | cfw0um0 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 20 |
lolphp | Innominate8 | cfwj077 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 19 |
lolphp | ahruss | cfwm2te | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 15 |
lolphp | ahruss | cfwhwa6 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>> These functions will return false for a string, even if it contains an integer.
Strings can't contain integers, they can only contains strings of characters. PHP's loose typi... | 12 |
lolphp | vita10gy | cfw20i1 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>PHP has 10,000+ loose functions built in, but you still have to roll your own for even the most basic things.<|eor|><|sor|>I hate php, but I've been using it part or full time fo... | 10 |
lolphp | vita10gy | cfw6216 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>PHP has 10,000+ loose functions built in, but you still have to roll your own for even the most basic things.<|eor|><|sor|>I hate php, but I've been using it part or full time fo... | 10 |
lolphp | sickofthisshit | cfwtrk7 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>> These functions will return false for a string, even if it contains an integer.
Strings can't contain integers, they can only contains strings of characters. PHP's loose typi... | 9 |
lolphp | ahruss | cfwvf3o | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 9 |
lolphp | Serialk | cfy56gg | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 9 |
lolphp | Rainfly_X | cfvxvyj | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>One of the fonts is broken, and I 90% of this page is empty space.<|eor|><|eols|><|endoftext|> | 8 |
lolphp | rcxdude | cfy8an7 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 7 |
lolphp | djsumdog | cfw7cpz | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>PHP has 10,000+ loose functions built in, but you still have to roll your own for even the most basic things.<|eor|><|sor|>I hate php, but I've been using it part or full time fo... | 6 |
lolphp | catcradle5 | cfwmbv6 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>is regex that slow? I think if your code is performance-sensitive enough that using a regex would cause significant issues, you probably shouldn't be using PHP to begin with. <|e... | 6 |
lolphp | gavintlgold | cfvygyn | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>One of the fonts is broken, and I 90% of this page is empty space.<|eor|><|sor|>Refreshing the page fixed that for me.<|eor|><|eols|><|endoftext|> | 5 |
lolphp | vita10gy | cfwkce7 | <|sols|><|sot|>This is how you reliably check for an integer in PHP<|eot|><|sol|>http://wisercoder.com/check-for-integer-in-php/<|eol|><|sor|>PHP has 10,000+ loose functions built in, but you still have to roll your own for even the most basic things.<|eor|><|sor|>I hate php, but I've been using it part or full time fo... | 5 |
lolphp | NotSantaAtAll | 1ist19 | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|eols|><|endoftext|> | 50 |
lolphp | tdammers | cb7oxqf | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>This is something PHP more or less inherits directly from C, where the following is undefined as well:
int i = 1;
i = ++i + i++;
printf("%i\n", i);<|eor|><|e... | 39 |
lolphp | barubary | cb7puti | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>This is something PHP more or less inherits directly from C, where the following is undefined as well:
int i = 1;
i = ++i + i++;
printf("%i\n", i);<|eor|><|s... | 35 |
lolphp | Drainedsoul | cb7pjxl | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>If this is "*lolphp*" it's also "*lolc*" and "*lolc++*" too.
Undefined behaviour isn't "*lol*", it's -- in many cases -- necessary or preferable so that the compiler (or... | 28 |
lolphp | djsumdog | cb7psu6 | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>If this is "*lolphp*" it's also "*lolc*" and "*lolc++*" too.
Undefined behaviour isn't "*lol*", it's -- in many cases -- necessary or preferable so that the compiler (or... | 16 |
lolphp | phoshi | cb7wu2y | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>If this is "*lolphp*" it's also "*lolc*" and "*lolc++*" too.
Undefined behaviour isn't "*lol*", it's -- in many cases -- necessary or preferable so that the compiler (or... | 15 |
lolphp | farsightxr20 | cb8c614 | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>> // mixing ++ and + produces undefined behavior
PHP has defined behavior? Where can I find the spec?<|eor|><|eols|><|endoftext|> | 14 |
lolphp | InconsiderateBastard | cb7twlk | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>Wait, why would that output 5?
$b = ++$a; echo $b + $a++; --> 2 + 2 = 4
$b = $a++; echo ++$a + $b; --> 3 + 1 = 4<|eor|><|sor|>Because undefined behavior. It cou... | 13 |
lolphp | dipswitch | cb7yh1m | <|sols|><|sot|>echo ++$a + $a++; // may print 4 or 5<|eot|><|sol|>http://php.net/manual/en/language.operators.precedence.php#example-114<|eol|><|sor|>Wait, why would that output 5?
$b = ++$a; echo $b + $a++; --> 2 + 2 = 4
$b = $a++; echo ++$a + $b; --> 3 + 1 = 4<|eor|><|sor|>Because undefined behavior. It cou... | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.