subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
ealf
j21bv
<|sols|><|sot|>Guess the output: echo(1) and print(2) and die(3);<|eot|><|sol|>http://writecodeonline.com/php/?code=echo%281%29+and+print%282%29+and+die%283%29%3B<|eol|><|eols|><|endoftext|>
15
lolphp
gwynjudd
c2eexj7
<|sols|><|sot|>Guess the output: echo(1) and print(2) and die(3);<|eot|><|sol|>http://writecodeonline.com/php/?code=echo%281%29+and+print%282%29+and+die%283%29%3B<|eol|><|sor|>I don't see the problem. Is your complaint that the expected type of the parameter isn't consistent across 3 differing functions?<|eor|><|soopr|...
10
lolphp
ealf
c28mb11
<|sols|><|sot|>Guess the output: echo(1) and print(2) and die(3);<|eot|><|sol|>http://writecodeonline.com/php/?code=echo%281%29+and+print%282%29+and+die%283%29%3B<|eol|><|sor|>I don't see the problem. Is your complaint that the expected type of the parameter isn't consistent across 3 differing functions?<|eor|><|soopr|...
7
lolphp
tian2992
hcwbi
<|soss|><|sot|>print(42+"-"+1024);<|eot|><|sost|>1066 Casting tables gone mad.<|eost|><|eoss|><|endoftext|>
15
lolphp
Hazasoul
c35mgea
<|soss|><|sot|>print(42+"-"+1024);<|eot|><|sost|>1066 Casting tables gone mad.<|eost|><|sor|>Lua 5.1: > print(42+"-"+1024) stdin:1: attempt to perform arithmetic on a string value However, Lua also have some automatic conversions build in, just not braindead ones: > print(4+"2") 6 <|eor|><|sor|>(Sor...
6
lolphp
wvenable
c2epitv
<|soss|><|sot|>print(42+"-"+1024);<|eot|><|sost|>1066 Casting tables gone mad.<|eost|><|sor|>What the...? I was expecting -982 or possibly 982. 1066 is positively boggling.<|eor|><|sor|>You seem to think there should be some string concatenation going on instead of addition, but those are separate operators in PHP. ...
6
lolphp
tian2992
c1uias2
<|soss|><|sot|>print(42+"-"+1024);<|eot|><|sost|>1066 Casting tables gone mad.<|eost|><|sor|>What the...? I was expecting -982 or possibly 982. 1066 is positively boggling.<|eor|><|soopr|>"-" gets casted to "-0"<|eoopr|><|eoss|><|endoftext|>
5
lolphp
pilif
10qner8
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|eols|><|endoftext|>
15
lolphp
funtek
j6r186l
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>Which is why you never let date functions guess the input format. This is true for most languages and date libraries. Compare: https://3v4l.org/vog1j<|eor|><|eols|><|endoftext|>
15
lolphp
elcapitanoooo
j6rupf7
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>Which is why you never let date functions guess the input format. This is true for most languages and date libraries. Compare: https://3v4l.org/vog1j<|eor|><|sor|>I dont see how is this lolphp defendable. A l...
15
lolphp
kyou20
j6rp3j4
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>Which is why you never let date functions guess the input format. This is true for most languages and date libraries. Compare: https://3v4l.org/vog1j<|eor|><|sor|>I dont see how is this lolphp defendable. A l...
12
lolphp
funtek
j6rroo4
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>Which is why you never let date functions guess the input format. This is true for most languages and date libraries. Compare: https://3v4l.org/vog1j<|eor|><|sor|>I dont see how is this lolphp defendable. A l...
9
lolphp
elcapitanoooo
j6ru0os
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>DateTime in PHP is such a clusterfuck. Have been bitten on so many occations. IIRC there was a bug that allowed you to modify an DateTimeImmutable object. Just mindbendingly bad Edit. Heres the datetime immu...
8
lolphp
Alekzcb
j6u19qe
<|sols|><|sot|>DateTime silently corrupting unsupported data.<|eot|><|sol|>https://3v4l.org/2Tsuf<|eol|><|sor|>DateTime in PHP is such a clusterfuck. Have been bitten on so many occations. IIRC there was a bug that allowed you to modify an DateTimeImmutable object. Just mindbendingly bad Edit. Heres the datetime immu...
5
lolphp
Takeoded
fgaz6f
<|sols|><|sot|>boolval() doesn't agree with FILTER_VALIDATE_BOOLEAN<|eot|><|sol|>https://3v4l.org/bOrhG<|eol|><|eols|><|endoftext|>
14
lolphp
bj_christianson
fk3utd7
<|sols|><|sot|>boolval() doesn't agree with FILTER_VALIDATE_BOOLEAN<|eot|><|sol|>https://3v4l.org/bOrhG<|eol|><|sor|>The issue here is that `boolval()` is for language coercion, but `FILTER_VALIDATE_BOOLEAN` is for filtering web input. Some forms return "Off" or "On" for checkboxes. So the filter has to accept those va...
19
lolphp
SirClueless
fk3wt7y
<|sols|><|sot|>boolval() doesn't agree with FILTER_VALIDATE_BOOLEAN<|eot|><|sol|>https://3v4l.org/bOrhG<|eol|><|sor|>The issue here is that `boolval()` is for language coercion, but `FILTER_VALIDATE_BOOLEAN` is for filtering web input. Some forms return "Off" or "On" for checkboxes. So the filter has to accept those va...
16
lolphp
Takeoded
eyocft
<|sols|><|sot|>how to call dynamically added methods<|eot|><|sol|>https://3v4l.org/MppBE<|eol|><|eols|><|endoftext|>
16
lolphp
sproingie
fgiqi3f
<|sols|><|sot|>how to call dynamically added methods<|eot|><|sol|>https://3v4l.org/MppBE<|eol|><|sor|>PHP methods and attributes are in different namespaces. `($o->f)()` works. Likely you won't have access to `$this` however.<|eor|><|eols|><|endoftext|>
17
lolphp
barubary
fgirdpv
<|sols|><|sot|>how to call dynamically added methods<|eot|><|sol|>https://3v4l.org/MppBE<|eol|><|sor|>Both `($o->f)()` and `call_user_func($o->f)` work.<|eor|><|eols|><|endoftext|>
9
lolphp
SerdanKK
fgjf0uu
<|sols|><|sot|>how to call dynamically added methods<|eot|><|sol|>https://3v4l.org/MppBE<|eol|><|sor|>PHP methods and attributes are in different namespaces. `($o->f)()` works. Likely you won't have access to `$this` however.<|eor|><|sor|>You can use `$this` if you bind the closure to an object. [https://3v4l.org/Bk...
7
lolphp
barubary
fgk4wb6
<|sols|><|sot|>how to call dynamically added methods<|eot|><|sol|>https://3v4l.org/MppBE<|eol|><|sor|>PHP methods and attributes are in different namespaces. `($o->f)()` works. Likely you won't have access to `$this` however.<|eor|><|sor|>Wait so you can call variables that contain functions directly, but if the func...
5
lolphp
Takeoded
ebfcoi
<|sols|><|sot|>FILTER_VALIDATE_BOOLEAN validates emptystring as bool<|eot|><|sol|>https://3v4l.org/lpE2l<|eol|><|eols|><|endoftext|>
14
lolphp
SaltineAmerican_1970
fb4ztju
<|sols|><|sot|>FILTER_VALIDATE_BOOLEAN validates emptystring as bool<|eot|><|sol|>https://3v4l.org/lpE2l<|eol|><|sor|>> IfFILTER_NULL_ON_FAILUREis set,FALSEis returned only for "0", "false", "off", "no", and "", andNULLis returned for all non-boolean values. Edit: https://www.php.net/manual/en/filter.filters.validate....
6
lolphp
philsturgeon
2xaenk
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
11
lolphp
tdammers
coyuiph
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
29
lolphp
_vec_
coyg8t3
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
11
lolphp
tdammers
cp02ogr
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
9
lolphp
tdammers
coz1aq7
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
9
lolphp
allthediamonds
coygzvt
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
8
lolphp
EsperSpirit
cp5ko56
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
8
lolphp
thallippoli
cozn2rf
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
8
lolphp
tdammers
cp132ca
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
7
lolphp
cparen
coz2yo5
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
iheartrms
coyhk7y
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
philsturgeon
coz4ccm
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
tdammers
cp026d8
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
philsturgeon
cp0810x
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
philsturgeon
cp004e7
<|soss|><|sot|>Patently False Code/Examples<|eot|><|sost|>I've notice a bit of a trend here, with people posting things that are patently false and then laughing about PHP for it. I'll sit with you and laugh at weird behaviors in PHP when it's actually a mess. I'll send them to [phpsadness.com](http://phpsadness.com) ...
5
lolphp
Altreus
x0pbp
<|sols|><|sot|>When I actually looked up empty() for this post I discovered half of my point was made for me.<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/empty-considered-harmful.html<|eol|><|eols|><|endoftext|>
12
lolphp
alx5000
c5i61n1
<|sols|><|sot|>When I actually looked up empty() for this post I discovered half of my point was made for me.<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/empty-considered-harmful.html<|eol|><|sor|>I guess the rationale for this is that you can avoid doing an extra isset(). For example, I can easily do if (e...
8
lolphp
imMute
c5ib369
<|sols|><|sot|>When I actually looked up empty() for this post I discovered half of my point was made for me.<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/empty-considered-harmful.html<|eol|><|sor|>Is this guy serious? I would say this is one of the best features of PHP. If you want to check if something exists, ...
8
lolphp
gearvOsh
c5i76l9
<|sols|><|sot|>When I actually looked up empty() for this post I discovered half of my point was made for me.<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/empty-considered-harmful.html<|eol|><|sor|>Is this guy serious? I would say this is one of the best features of PHP. If you want to check if something exists, ...
5
lolphp
huf
c5ibdn9
<|sols|><|sot|>When I actually looked up empty() for this post I discovered half of my point was made for me.<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/empty-considered-harmful.html<|eol|><|sor|>Is this guy serious? I would say this is one of the best features of PHP. If you want to check if something exists, ...
5
lolphp
Altreus
wtkcl
<|sols|><|sot|>Today's PHP-induced bug: arbitrary object properties (PHP fucks me off daily so I've decided to chronicle it)<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/todays-php-induced-bug-arbitrary-object.html<|eol|><|eols|><|endoftext|>
13
lolphp
InconsiderateBastard
c5ghk6z
<|sols|><|sot|>Today's PHP-induced bug: arbitrary object properties (PHP fucks me off daily so I've decided to chronicle it)<|eot|><|sol|>http://altreus.blogspot.co.uk/2012/07/todays-php-induced-bug-arbitrary-object.html<|eol|><|sor|>> Point 1 of the two reasons why you don't do what PHP doesn't understand why you don'...
7
lolphp
Takeoded
sxt4oz
<|sols|><|sot|>crypt() on failure: return <13 characters of garbage.. makes sense<|eot|><|sol|>https://www.php.net/manual/en/function.crypt<|eol|><|eols|><|endoftext|>
14
lolphp
smegnose
hxu7h2i
<|sols|><|sot|>crypt() on failure: return <13 characters of garbage.. makes sense<|eot|><|sol|>https://www.php.net/manual/en/function.crypt<|eol|><|sor|>Is this another classic u/Takeoded post? So the function is strongly typed, thus guaranteed to be able to be fed into other functions, and will definitely not match th...
12
lolphp
duskwuff
hxw0173
<|sols|><|sot|>crypt() on failure: return <13 characters of garbage.. makes sense<|eot|><|sol|>https://www.php.net/manual/en/function.crypt<|eol|><|sor|>[deleted]<|eor|><|sor|>That isn't "13 characters of garbage". It's the standard DES hash of `garbage` with the salt `ga` (first two characters of `$salt`), exactly as ...
11
lolphp
duskwuff
hxzvnqv
<|sols|><|sot|>crypt() on failure: return <13 characters of garbage.. makes sense<|eot|><|sol|>https://www.php.net/manual/en/function.crypt<|eol|><|sor|>Is this another classic u/Takeoded post? So the function is strongly typed, thus guaranteed to be able to be fed into other functions, and will definitely not match th...
6
lolphp
Takeoded
dbenbs
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
12
lolphp
the_alias_of_andrea
f20w0iz
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
25
lolphp
Takeoded
f20xi47
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
24
lolphp
nikic
f2107pc
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
20
lolphp
Takeoded
f21j95l
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
5
lolphp
the_alias_of_andrea
f224wtb
<|soss|><|sot|>(7.4) floats can have default values, but not double<|eot|><|sost|>as of PHP 7.4 (currently in Release Candidate 2, so i don't expect a fix for this prior to release), we can now have typed properties, it looks like this: ```php class C{ public float $f = 0.0; public double $d = 0.0; } ``` ... f...
5
lolphp
daxim
d9gpz3
<|sols|><|sot|>No, PHP Doesn't Have Closures<|eot|><|sol|>https://nullprogram.com/blog/2019/09/25/<|eol|><|eols|><|endoftext|>
13
lolphp
PonchoVire
f1h8afc
<|sols|><|sot|>No, PHP Doesn't Have Closures<|eot|><|sol|>https://nullprogram.com/blog/2019/09/25/<|eol|><|soopr|> <?php function bar($n) { $f = function() use ($n) { return $n; }; $n++; return $f; } var_dump(bar(1)()); // int(1) ---- #!/usr/bin/env node ...
14
lolphp
jesseschalken
f1id4nu
<|sols|><|sot|>No, PHP Doesn't Have Closures<|eot|><|sol|>https://nullprogram.com/blog/2019/09/25/<|eol|><|sor|>Where did he get the idea that a closure isn't a closure unless it captures the variable by reference? He seems to have just made that up. If it were true, Haskell, Ocaml and even C++ wouldn't have closures,...
10
lolphp
daxim
f1h5r0g
<|sols|><|sot|>No, PHP Doesn't Have Closures<|eot|><|sol|>https://nullprogram.com/blog/2019/09/25/<|eol|><|soopr|> <?php function bar($n) { $f = function() use ($n) { return $n; }; $n++; return $f; } var_dump(bar(1)()); // int(1) ---- #!/usr/bin/env node ...
5
lolphp
daxim
f1hayor
<|sols|><|sot|>No, PHP Doesn't Have Closures<|eot|><|sol|>https://nullprogram.com/blog/2019/09/25/<|eol|><|soopr|> <?php function bar($n) { $f = function() use ($n) { return $n; }; $n++; return $f; } var_dump(bar(1)()); // int(1) ---- #!/usr/bin/env node ...
5
lolphp
dzuczek
d0hwoa
<|soss|><|sot|>timewarps to the year 2001<|eot|><|sost|>// 1 BC php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, -1)); -0001-02-21 // 1 AD php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, 1)); 2001-02-21<|eost|><|eoss|><|endoftext|>
13
lolphp
the_alias_of_andrea
ezam92p
<|soss|><|sot|>timewarps to the year 2001<|eot|><|sost|>// 1 BC php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, -1)); -0001-02-21 // 1 AD php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, 1)); 2001-02-21<|eost|><|sor|>[deleted]<|eor|><|sor|>> Javascript, which has the same syntax for that, treats this as a num...
12
lolphp
barubary
eza43nj
<|soss|><|sot|>timewarps to the year 2001<|eot|><|sost|>// 1 BC php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, -1)); -0001-02-21 // 1 AD php > print date('Y-m-d', mktime(0, 0, 0, 2, 21, 1)); 2001-02-21<|eost|><|sor|>[deleted]<|eor|><|sor|>> Javascript, which has the same syntax for that, treats this as a num...
11
lolphp
pilif
740deb
<|sols|><|sot|>SplFileInfo->current() has side-effects. ->valid() will never be false until you call ->current()<|eot|><|sol|>https://3v4l.org/W0rL2<|eol|><|eols|><|endoftext|>
14
lolphp
maweki
dnuhteo
<|sols|><|sot|>SplFileInfo->current() has side-effects. ->valid() will never be false until you call ->current()<|eot|><|sol|>https://3v4l.org/W0rL2<|eol|><|sor|>It's not about the side effects. About everything moves the read-pointer. valid checks for EOF which is unknown until something is read. The real WTF here is...
9
lolphp
h4l
41ejnm
<|sols|><|sot|>PHP debugger XDebug can't break on or step into single-line conditional blocks (without braces) due to the way PHP assigns line numbers to its bytecode<|eot|><|sol|>http://bugs.xdebug.org/view.php?id=842<|eol|><|eols|><|endoftext|>
13
lolphp
the_alias_of_andrea
cz1rv29
<|sols|><|sot|>PHP debugger XDebug can't break on or step into single-line conditional blocks (without braces) due to the way PHP assigns line numbers to its bytecode<|eot|><|sol|>http://bugs.xdebug.org/view.php?id=842<|eol|><|sor|>Yes, PHP has bugs. This is from three and a half years ago, before the PHP compiler was ...
22
lolphp
the_alias_of_andrea
cz1y4a5
<|sols|><|sot|>PHP debugger XDebug can't break on or step into single-line conditional blocks (without braces) due to the way PHP assigns line numbers to its bytecode<|eot|><|sol|>http://bugs.xdebug.org/view.php?id=842<|eol|><|sor|>Yes, PHP has bugs. This is from three and a half years ago, before the PHP compiler was ...
5
lolphp
Max-P
2ktoz5
<|sols|><|sot|>htmlentities can convert accentuated characters, but only if the user typed it in the correct way ( ~= &agrave)<|eot|><|sol|>http://3v4l.org/Ftoto<|eol|><|eols|><|endoftext|>
11
lolphp
allthediamonds
clolr6s
<|sols|><|sot|>htmlentities can convert accentuated characters, but only if the user typed it in the correct way ( ~= &agrave)<|eot|><|sol|>http://3v4l.org/Ftoto<|eol|><|sor|>Is there a single function on the PHP standard library that **isn't** a bug waiting to happen?<|eor|><|eols|><|endoftext|>
12
lolphp
Scaliwag
cloobfh
<|sols|><|sot|>htmlentities can convert accentuated characters, but only if the user typed it in the correct way ( ~= &agrave)<|eot|><|sol|>http://3v4l.org/Ftoto<|eol|><|soopr|>To be really extra fair, I didn't know the same character could be encoded differently either until it blew up on me today. htmlentities probab...
9
lolphp
Rhomboid
clpe5na
<|sols|><|sot|>htmlentities can convert accentuated characters, but only if the user typed it in the correct way ( ~= &agrave)<|eot|><|sol|>http://3v4l.org/Ftoto<|eol|><|sor|>What's the correct way? I'm not getting it. <|eor|><|sor|>The first is the precomposed form: U+00E0 (LATIN SMALL LETTER A WITH GRAVE). The seco...
8
lolphp
allthediamonds
cloosti
<|sols|><|sot|>htmlentities can convert accentuated characters, but only if the user typed it in the correct way ( ~= &agrave)<|eot|><|sol|>http://3v4l.org/Ftoto<|eol|><|soopr|>To be really extra fair, I didn't know the same character could be encoded differently either until it blew up on me today. htmlentities probab...
6
lolphp
TheGreatFohl
2jxgcg
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|eols|><|endoftext|>
13
lolphp
allthediamonds
clgdjov
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|soopr|>Because [array_unique](http://php.net/manual/en/function.array-unique.php) converts everything to strings to sort it. Obviously you need to use the SORT_REGULAR flag which is, logically, not the default option. EDIT: I...
16
lolphp
x3al
clgbozm
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|soopr|>Because [array_unique](http://php.net/manual/en/function.array-unique.php) converts everything to strings to sort it. Obviously you need to use the SORT_REGULAR flag which is, logically, not the default option. EDIT: I...
13
lolphp
willglynn
clgi5z4
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|sor|>I enjoyed [the changelog](http://php.net/manual/en/function.array-unique.php#refsect1-function.array-unique-changelog): > ## Changelog > > > > Version | Description > ---|--- > 5.2.10 | Changed the default value of `sor...
12
lolphp
TheGreatFohl
clgdus6
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|soopr|>Because [array_unique](http://php.net/manual/en/function.array-unique.php) converts everything to strings to sort it. Obviously you need to use the SORT_REGULAR flag which is, logically, not the default option. EDIT: I...
9
lolphp
TheGreatFohl
clfyaig
<|sols|><|sot|>array_unique and objects => *boom*<|eot|><|sol|>http://3v4l.org/jABl1<|eol|><|soopr|>Because [array_unique](http://php.net/manual/en/function.array-unique.php) converts everything to strings to sort it. Obviously you need to use the SORT_REGULAR flag which is, logically, not the default option. EDIT: I...
6
lolphp
krinndnz
120r50
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|eols|><|endoftext|>
11
lolphp
infinull
c6rcwkn
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|sor|>I know it's trendy to bash PHP, but you can write elegant, well-performing code in PHP. Of course, Wordpress doesn't do that...<|eor|><|sor|>Well yes...
11
lolphp
SirClueless
c6rb92z
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|sor|>I know it's trendy to bash PHP, but you can write elegant, well-performing code in PHP. Of course, Wordpress doesn't do that...<|eor|><|sor|>Well yes...
9
lolphp
krinndnz
c6rfvem
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|sor|>I know it's trendy to bash PHP, but you can write elegant, well-performing code in PHP. Of course, Wordpress doesn't do that...<|eor|><|sor|>Well yes...
8
lolphp
David_Crockett
c6rbess
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|sor|>I know it's trendy to bash PHP, but you can write elegant, well-performing code in PHP. Of course, Wordpress doesn't do that...<|eor|><|sor|>Well yes...
7
lolphp
David_Crockett
c6r9hag
<|sols|><|sot|>A comment thread about WPEngine issues becomes about WordPress' horrible architecture<|eot|><|sol|>http://news.ycombinator.com/item?id=4692456<|eol|><|sor|>I know it's trendy to bash PHP, but you can write elegant, well-performing code in PHP. Of course, Wordpress doesn't do that...<|eor|><|eols|><|endof...
5
lolphp
midir
xiz20
<|soss|><|sot|>Things which PHP thinks are equal<|eot|><|sost|>Give it a go: header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ...
14
lolphp
poizan42
c5oytml
<|soss|><|sot|>Things which PHP thinks are equal<|eot|><|sost|>Give it a go: header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ...
7
lolphp
Denommus
c5r2lst
<|soss|><|sot|>Things which PHP thinks are equal<|eot|><|sost|>Give it a go: header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ...
6
lolphp
JAPH
c5p2fa2
<|soss|><|sot|>Things which PHP thinks are equal<|eot|><|sost|>Give it a go: header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ...
5
lolphp
midir
c5sysax
<|soss|><|sot|>Things which PHP thinks are equal<|eot|><|sost|>Give it a go: header('Content-Type: text/plain'); function test($a, $b) { echo var_export($a, 1) . ' == ' . var_export($b, 1) . ' => ' . var_export($a == $b, 1) . "\n"; } test( null, '' ); // true test( null, array() ); // true test( '', array() ...
5
lolphp
barubary
d9kucp
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
13
lolphp
shinmai_rookie
f1ihls2
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
20
lolphp
barubary
f1imai5
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
18
lolphp
shinmai_rookie
f1ija2e
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
12
lolphp
Retzudo
f1iipbe
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
7
lolphp
barubary
f1jhpen
<|soss|><|sot|>-2 squared is -4<|eot|><|sost|>[Floating point numbers](https://www.php.net/manual/en/language.types.float.php), quoth the manual: > Formally: > LNUM [0-9]+ > DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) > EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) In other w...
6
lolphp
nexxai
axp3ye
<|sols|><|sot|>Bug opened 2006-08-22 and still open - PHP :: Bug #38546 :: bindParam incorrect processing of bool types<|eot|><|sol|>https://bugs.php.net/bug.php?id=38546<|eol|><|eols|><|endoftext|>
12
lolphp
dotancohen
ehwlm71
<|sols|><|sot|>Bug opened 2006-08-22 and still open - PHP :: Bug #38546 :: bindParam incorrect processing of bool types<|eot|><|sol|>https://bugs.php.net/bug.php?id=38546<|eol|><|sor|>I don't understand the sudden interest in old bugs on lolphp. Every project has decades-old bugs. One can sort by date and find some ope...
10
lolphp
ntzm_
akm5io
<|sols|><|sot|>The fuckery that is $http_response_header<|eot|><|sol|>https://twitter.com/asgrim/status/1089117795957256193<|eol|><|eols|><|endoftext|>
12