subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
Saltub
dlc7ut9
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>Instead of being so smug, why don't you report it as a bug?<|eor|><|sor|>I've reported you as a bug.<|eor|><|eols|><|endoftext|>
21
lolphp
the_alias_of_andrea
dlcjpxt
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>Seems to me somebody should've read [RFC 3986](https://tools.ietf.org/html/rfc3986) before haphazardly implementing something like that. [Here's the PHP source](https://github.com/php/php-src/blob/513b0093c2b480...
20
lolphp
minimim
dlc8tf3
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>Seems to me somebody should've read [RFC 3986](https://tools.ietf.org/html/rfc3986) before haphazardly implementing something like that. [Here's the PHP source](https://github.com/php/php-src/blob/513b0093c2b480...
13
lolphp
nyamsprod
dldg4it
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>It shouldn't be deprecated, its guts should be ripped out and rewritten.<|eor|><|soopr|>I believe some scripts out there sadly depends on its current guts form _ that's why we need`real_parse_url` or even better...
11
lolphp
nyamsprod
dlc2qdm
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>Instead of being so smug, why don't you report it as a bug?<|eor|><|soopr|>Because I prefer to get this ASAP https://wiki.php.net/rfc/replace_parse_url I was hoping PHP7.2 would ship with it<|eoopr|><|eols|><|end...
10
lolphp
mikeputerbaugh
dlhqm0v
<|sols|><|sot|>When is parse_url going to be deprecated ?<|eot|><|sol|>https://3v4l.org/ht82k<|eol|><|sor|>It shouldn't be deprecated, its guts should be ripped out and rewritten.<|eor|><|soopr|>I believe some scripts out there sadly depends on its current guts form _ that's why we need`real_parse_url` or even better...
8
lolphp
MMauro94
6k0p40
<|sols|><|sot|>array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string<|eot|><|sol|>https://3v4l.org/BaUji<|eol|><|eols|><|endoftext|>
38
lolphp
the_alias_of_andrea
djil8x0
<|sols|><|sot|>array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string<|eot|><|sol|>https://3v4l.org/BaUji<|eol|><|sor|>The handling of Exceptions and Errors (Throwables) with internal functions is a bit of a tricky issue, because basically we can't just unwind the C...
18
lolphp
masklinn
djv2bxb
<|sols|><|sot|>array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string<|eot|><|sol|>https://3v4l.org/BaUji<|eol|><|sor|>The handling of Exceptions and Errors (Throwables) with internal functions is a bit of a tricky issue, because basically we can't just unwind the C...
9
lolphp
Various_Pickles
djqs3vi
<|sols|><|sot|>array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string<|eot|><|sol|>https://3v4l.org/BaUji<|eol|><|sor|>Exception handling in PHP is dependent on rolling a 15+ for initiative at the start of the encounter with the roving band of 2d4 manscorpions.<|eor...
7
lolphp
DoctorWaluigiTime
djjw3bk
<|sols|><|sot|>array_diff breaks Exception catching when passing two arrays containing an item that can't be cast to string<|eot|><|sol|>https://3v4l.org/BaUji<|eol|><|sor|>The handling of Exceptions and Errors (Throwables) with internal functions is a bit of a tricky issue, because basically we can't just unwind the C...
6
lolphp
Rican7
4becxk
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|eols|><|endoftext|>
36
lolphp
andsens
d18dnq6
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|sor|>Dear lord, that's horrible. Don't tell me they made their own [zoneinfo](https://en.wikipedia.org/wiki/Tz_database)?<|eor|><|eols|><|endoftext|>
20
lolphp
treenaks
d18u9t0
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|sor|>Dear lord, that's horrible. Don't tell me they made their own [zoneinfo](https://en.wikipedia.org/wiki/Tz_database)?<|eor|><|sor|>[Don't make your own zoneinfo](https://www.youtube.com/watch?v=-5wpm-gesOY)<|eor|><|eo...
16
lolphp
treenaks
d18wnve
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|sor|>Dear lord, that's horrible. Don't tell me they made their own [zoneinfo](https://en.wikipedia.org/wiki/Tz_database)?<|eor|><|sor|>[Don't make your own zoneinfo](https://www.youtube.com/watch?v=-5wpm-gesOY)<|eor|><|so...
13
lolphp
andsens
d18wi7w
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|sor|>Dear lord, that's horrible. Don't tell me they made their own [zoneinfo](https://en.wikipedia.org/wiki/Tz_database)?<|eor|><|sor|>[Don't make your own zoneinfo](https://www.youtube.com/watch?v=-5wpm-gesOY)<|eor|><|so...
7
lolphp
the_alias_of_andrea
d18wqza
<|sols|><|sot|>PHP doesn't understand daylight savings<|eot|><|sol|>https://3v4l.org/iTeSL<|eol|><|sor|>Weird. I wonder if EST and EDT are aliased because they're often confused.<|eor|><|eols|><|endoftext|>
6
lolphp
gibranois
3xkhvk
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|eols|><|endoftext|>
40
lolphp
aaarrrggh
cy5fhux
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
72
lolphp
Schmittfried
cy5j9t4
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
35
lolphp
myhf
cy5ff1a
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Wow he wrote Go and RoR. My brains are melting out.<|eor|><|eols|><|endoftext|>
33
lolphp
the_alias_of_andrea
cy5k01a
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Wow he wrote Go and RoR. My brains are melting out.<|eor|><|sor|>By that I think he means he wrote *in* them. His point is that he's...
25
lolphp
the_alias_of_andrea
cy5jw0g
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>People want to see things that confirm their biases. <|eor|><|sor|>PHP has a problem with this. Instead of reacting to statements th...
23
lolphp
AlGoreBestGore
cy5q7yh
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>> I'm really excited for ~2018-2022 or so when we shit on the node.js community. lol<|eor|><|eols|><|endoftext|>
21
lolphp
Synes_Godt_Om
cy5s3qn
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Same kind of cycle as Microsoft's had with their products 1. THIS PRODUCT IS PERFECT YOU'RE JUST AN IDIOT 1. THE LAST VERSION WAS A...
20
lolphp
BilgeXA
cy5j2au
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Phil Sturgeon is a schmuck who genuinely believes he is a legend among men, and sadly, things like this only serve to fuel that ego....
19
lolphp
the_alias_of_andrea
cy5jz3b
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
17
lolphp
the_alias_of_andrea
cy5odxc
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
17
lolphp
smog_alado
cy5hg51
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>tbh, Go and RoR are also silly in their own way.<|eor|><|eols|><|endoftext|>
16
lolphp
polish_niceguy
cy61zxv
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
15
lolphp
Vakieh
cy5ywy9
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Same kind of cycle as Microsoft's had with their products 1. THIS PRODUCT IS PERFECT YOU'RE JUST AN IDIOT 1. THE LAST VERSION WAS A...
14
lolphp
dagbrown
cy62xz5
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
14
lolphp
the_alias_of_andrea
cy5k11c
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Phil Sturgeon is a schmuck who genuinely believes he is a legend among men, and sadly, things like this only serve to fuel that ego....
13
lolphp
philsturgeon
cy63dgr
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>Phil Sturgeon is a schmuck who genuinely believes he is a legend among men, and sadly, things like this only serve to fuel that ego....
13
lolphp
philsturgeon
cy6p8le
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>It's kinda a fair point though. Php has improved a lot over the years, as have the practises employed by much of the community. His ...
12
lolphp
metamorphosis
cy5y3cq
<|sols|><|sot|>The kind of thing that gets upvoted in /r/php<|eot|><|sol|>https://www.reddit.com/r/PHP/comments/3x9wqn/why_do_people_keep_saying_php_isnt_used_for_the/cy2v9py<|eol|><|sor|>I gurantee that 95% of people here don't even come close to phils expirience. I am all ok for PHP bashing, as sometime it deserves ...
11
lolphp
m1el
3l27nz
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|eols|><|endoftext|>
40
lolphp
m1el
cv2i3fx
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|soopr|> m1el@m1el:/tmp$ cat symlink.php <?php if (!chdir("/tmp")) { print("failed to chdir to tmp"); die(); } system("mkdir dir_one dir_tw...
20
lolphp
urquan
cv2vgfb
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|soopr|> m1el@m1el:/tmp$ cat symlink.php <?php if (!chdir("/tmp")) { print("failed to chdir to tmp"); die(); } system("mkdir dir_one dir_tw...
20
lolphp
Vakieh
cv3ac5k
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|sor|>The article notes that this is a common optimization even in non-php software > Many other softwares use a stat cache, read their source code and you'll notice that ;-)...
14
lolphp
merreborn
cv35v2m
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|sor|>The article notes that this is a common optimization even in non-php software > Many other softwares use a stat cache, read their source code and you'll notice that ;-)...
11
lolphp
vytah
cv4j7oz
<|sols|><|sot|>lstat syscall is too expensive, let's lie to the user<|eot|><|sol|>http://jpauli.github.io/2014/06/30/realpath-cache.html<|eol|><|sor|>[deleted]<|eor|><|sor|> >#clearstatcache >(PHP 4, PHP 5, PHP 7) >clearstatcache Clears file status cache >###Parameters >`clear_realpath_cache` >&nbsp;&nbsp;&nbsp;...
5
lolphp
realnowhereman
2e75dx
<|sols|><|sot|>An essay on variable variables<|eot|><|sol|>http://www.reddit.com/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38<|eol|><|eols|><|endoftext|>
33
lolphp
robertbieber
cjx4j8r
<|sols|><|sot|>An essay on variable variables<|eot|><|sol|>http://www.reddit.com/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38<|eol|><|sor|>THANKS YOU. I saw this years ago, and haven't been able to find it since<|eor|><|eols|><|endoftext|>
7
lolphp
00Davo
cjx7s43
<|sols|><|sot|>An essay on variable variables<|eot|><|sol|>http://www.reddit.com/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38<|eol|><|sor|>I know you can do this sort of magic (i.e. hacking the scope) in PowerShell and JavaScript, and I suspect that you can do it in most dynamic lan...
7
lolphp
VeXCe
cjxcl3o
<|sols|><|sot|>An essay on variable variables<|eot|><|sol|>http://www.reddit.com/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38<|eol|><|sor|>This is actually pretty cool, but I reckon there aren't enough cool things (by far) to actually create a /r/wowphp. The only thing this needs i...
6
lolphp
Banane9
cjxdrlv
<|sols|><|sot|>An essay on variable variables<|eot|><|sol|>http://www.reddit.com/r/programming/comments/dst56/today_i_learned_about_php_variable_variables/c12np38<|eol|><|sor|>This is actually pretty cool, but I reckon there aren't enough cool things (by far) to actually create a /r/wowphp. The only thing this needs i...
5
lolphp
midir
1vftq6
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|eols|><|endoftext|>
38
lolphp
tdammers
ceru7dt
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Bit of a misleading thing going on there. The `+ 0` part doesn't just add 0, it also silently coerces from string to int. It's still broken in that the coercion rules are inconsistent and confusing (implicit coercion by ad...
17
lolphp
destroyeraseimprove
cerv5zz
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Bit of a misleading thing going on there. The `+ 0` part doesn't just add 0, it also silently coerces from string to int. It's still broken in that the coercion rules are inconsistent and confusing (implicit coercion by ad...
12
lolphp
midir
cerwcvh
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Bit of a misleading thing going on there. The `+ 0` part doesn't just add 0, it also silently coerces from string to int. It's still broken in that the coercion rules are inconsistent and confusing (implicit coercion by ad...
11
lolphp
ceol_
ces1jt4
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Bit of a misleading thing going on there. The `+ 0` part doesn't just add 0, it also silently coerces from string to int. It's still broken in that the coercion rules are inconsistent and confusing (implicit coercion by ad...
11
lolphp
ieccles
cervd91
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Pardon my ignorance, but... why the hell does casting the string "4294967295" to int become 2147483647? How are those numbers related?<|eor|><|sor|>`4294967295` is the maximum value an unsigned 32 bit integer can take, and...
8
lolphp
ceol_
ces1kw2
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Bit of a misleading thing going on there. The `+ 0` part doesn't just add 0, it also silently coerces from string to int. It's still broken in that the coercion rules are inconsistent and confusing (implicit coercion by ad...
6
lolphp
keis
cervsu7
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>And for added fun if you don't cast it to (int) in final variation you get float(4294967295)<|eor|><|eols|><|endoftext|>
5
lolphp
ismtrn
certwgr
<|sols|><|sot|>The difference that adding 0 makes<|eot|><|sol|>https://eval.in/90932<|eol|><|sor|>Wow. That is a quite cool feature.<|eor|><|eols|><|endoftext|>
5
lolphp
bozbalci
17wcav
<|sols|><|sot|>strstr: haystack, needle, before_needle.<|eot|><|sol|>http://www.php.net/manual/en/function.strstr.php<|eol|><|eols|><|endoftext|>
33
lolphp
merreborn
c89tsrn
<|sols|><|sot|>strstr: haystack, needle, before_needle.<|eot|><|sol|>http://www.php.net/manual/en/function.strstr.php<|eol|><|sor|>You should've linked to the [obviously far-superior version](http://www.php.net/manual/en/function.strstr.php#79347) posted in a comment. It's got TWO BONUS ARGUMENTS!<|eor|><|sor|>[deleted...
31
lolphp
farsightxr20
c89eyil
<|sols|><|sot|>strstr: haystack, needle, before_needle.<|eot|><|sol|>http://www.php.net/manual/en/function.strstr.php<|eol|><|sor|>You should've linked to the [obviously far-superior version](http://www.php.net/manual/en/function.strstr.php#79347) posted in a comment. It's got TWO BONUS ARGUMENTS!<|eor|><|eols|><|endof...
30
lolphp
infinull
c89j1y9
<|sols|><|sot|>strstr: haystack, needle, before_needle.<|eot|><|sol|>http://www.php.net/manual/en/function.strstr.php<|eol|><|sor|>seems like: list($before_needle, $after_needle) = explode($needle, $str, 2) would be better for that use case, but maybe Python has warped my brain (in a good way?)?<|eor|><|eols|><|e...
5
lolphp
guide42
c8jphjo
<|sols|><|sot|>strstr: haystack, needle, before_needle.<|eot|><|sol|>http://www.php.net/manual/en/function.strstr.php<|eol|><|sor|>You should've linked to the [obviously far-superior version](http://www.php.net/manual/en/function.strstr.php#79347) posted in a comment. It's got TWO BONUS ARGUMENTS!<|eor|><|sor|>[deleted...
5
lolphp
Altreus
pqk6r
<|soss|><|sot|>PHP emits more warnings about accessing an array as an array than accessing a string as an array<|eot|><|sost|> $array = array( 'a' => 'a', 'b' => 'b' ); $array['a']; # OK $array['c']; # HIDEOUS WARNING You can't turn this warning off without turning off other, useful warnings. This warning...
35
lolphp
dagbrown
c3rfmg7
<|soss|><|sot|>PHP emits more warnings about accessing an array as an array than accessing a string as an array<|eot|><|sost|> $array = array( 'a' => 'a', 'b' => 'b' ); $array['a']; # OK $array['c']; # HIDEOUS WARNING You can't turn this warning off without turning off other, useful warnings. This warning...
23
lolphp
ManchegoObfuscator
c3ricuy
<|soss|><|sot|>PHP emits more warnings about accessing an array as an array than accessing a string as an array<|eot|><|sost|> $array = array( 'a' => 'a', 'b' => 'b' ); $array['a']; # OK $array['c']; # HIDEOUS WARNING You can't turn this warning off without turning off other, useful warnings. This warning...
15
lolphp
Takeoded
uapav7
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|eols|><|endoftext|>
35
lolphp
Denvercoder8
i60pymb
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|sor|>Yes, what could possibly go wrong? The only issue I see here is that you're interpreting a value that's not specified by POSIX, the kernel, libc, or th...
17
lolphp
IluTov
i5z8yc6
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|sor|>For reference: https://github.com/php/php-src/pull/8429 This is indeed a wtf, I'll send a mail to internals to see if we can fix this for PHP 8.2.<|eor...
12
lolphp
Takeoded
i5z4twv
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|soopr|>normally LOCK_SH is 1 (1<<0) and LOCK_EX is 2 (1<<1) and LOCK_NB is 4 (1<<2) and LOCK_UN is 8 (1<<3) BUT in PHP: LOCK_SH is 1 (1<<0) and LOCK_EX is ...
8
lolphp
Takeoded
i5z953e
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|sor|>For reference: https://github.com/php/php-src/pull/8429 This is indeed a wtf, I'll send a mail to internals to see if we can fix this for PHP 8.2.<|eor...
8
lolphp
barubary
i6567od
<|sols|><|sot|>instead of using the standard 8 for LOCK_UN, let us invent our own value! what could possibly go wrong?<|eot|><|sol|>https://3v4l.org/tHWuc<|eol|><|soopr|>normally LOCK_SH is 1 (1<<0) and LOCK_EX is 2 (1<<1) and LOCK_NB is 4 (1<<2) and LOCK_UN is 8 (1<<3) BUT in PHP: LOCK_SH is 1 (1<<0) and LOCK_EX is ...
7
lolphp
nyamsprod
dq8962
<|sols|><|sot|>DateTime::createFromFormat and DateTime::__construct default initialisation are not consistent because why not ?<|eot|><|sol|>https://3v4l.org/VVGhH<|eol|><|eols|><|endoftext|>
36
lolphp
duskwuff
f61slrb
<|sols|><|sot|>DateTime::createFromFormat and DateTime::__construct default initialisation are not consistent because why not ?<|eot|><|sol|>https://3v4l.org/VVGhH<|eol|><|sor|>From the documentation for `DateTime::createFromFormat`: > If `format` does not contain the character `!` then portions of the generated time ...
15
lolphp
sproingie
f66dtvh
<|sols|><|sot|>DateTime::createFromFormat and DateTime::__construct default initialisation are not consistent because why not ?<|eot|><|sol|>https://3v4l.org/VVGhH<|eol|><|soopr|>while both behaviours might be logic taken independently the lack of consistency between both methods is the real lolphp<|eoopr|><|sor|>\Date...
11
lolphp
nyamsprod
f614ug8
<|sols|><|sot|>DateTime::createFromFormat and DateTime::__construct default initialisation are not consistent because why not ?<|eot|><|sol|>https://3v4l.org/VVGhH<|eol|><|soopr|>while both behaviours might be logic taken independently the lack of consistency between both methods is the real lolphp<|eoopr|><|eols|><|en...
7
lolphp
duskwuff
f61sion
<|sols|><|sot|>DateTime::createFromFormat and DateTime::__construct default initialisation are not consistent because why not ?<|eot|><|sol|>https://3v4l.org/VVGhH<|eol|><|sor|>PHP datetime class is a can of worms. You dont dont want to open it.<|eor|><|sor|>Yep, it's a mess. [Carbon](https://carbon.nesbot.com/) helps ...
7
lolphp
porkslow
7x0649
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|eols|><|endoftext|>
35
lolphp
SelfDistinction
du4o825
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>On the other hand WP has an amazing track record of not leaving people behind. That's more valuable then doing ...
19
lolphp
Saltub
du4rpch
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>Really cool coding standards like spaces immediately inside braces and all manner of other PSR-2 violations <|e...
13
lolphp
jurgemaister
du4kasz
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>On the other hand WP has an amazing track record of not leaving people behind. That's more valuable then doing ...
13
lolphp
porkslow
du6bhf0
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>What's the LOL here? <|eor|><|soopr|>WP core developers have had these standards for at least 5 years but actua...
6
lolphp
bart2019
du6bczi
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>What's the LOL here? <|eor|><|eols|><|endoftext|>
5
lolphp
deusex_
du4g1tc
<|sols|><|sot|>WordPress now mostly conforms to WordPress Coding Standards<|eot|><|sol|>https://make.wordpress.org/core/2017/11/30/wordpress-php-now-mostly-conforms-to-wordpress-coding-standards/<|eol|><|sor|>On the other hand WP has an amazing track record of not leaving people behind. That's more valuable then doing ...
5
lolphp
nindustries
7mln8t
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|eoss|><|endoftext|>
33
lolphp
Various_Pickles
drvz63d
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>Hinting does not a type system make. PHP type hints are like annotations in other languages, except drawn on a cardboard sign held by a homeless guy masturbating on the su...
16
lolphp
prewk
druw9id
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>That's pretty weird actually: https://3v4l.org/b8gQ2 Didn't know type hinting triggered type coercion.<|eor|><|eoss|><|endoftext|>
11
lolphp
Takeoded
druy3hw
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>That's pretty weird actually: https://3v4l.org/b8gQ2 Didn't know type hinting triggered type coercion.<|eor|><|sor|>at least it's optional. `declare(strict_types=1);`turns...
11
lolphp
Idontremember99
drv15cg
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>That's pretty weird actually: https://3v4l.org/b8gQ2 Didn't know type hinting triggered type coercion.<|eor|><|sor|>And it worked as expected for 5.6<|eor|><|sor|>No, it d...
11
lolphp
the_alias_of_andrea
drv6wf1
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>That's pretty weird actually: https://3v4l.org/b8gQ2 Didn't know type hinting triggered type coercion.<|eor|><|sor|>It's what the built-in functions do, and it fits with t...
7
lolphp
przemo_li
dscye0i
<|soss|><|sot|>Even with type hinting, 'false' on an INT argument will give you zero<|eot|><|sost|>false is type bool 0 is type int <|eost|><|sor|>It makes perfect sense. PHP do implicit type coercion. Type hinting thus only guarantee end result is correct value of given (pseudo)type, nothing more.<|eor|><|eoss|><|en...
6
lolphp
6f944ee6
5ywcig
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|eols|><|endoftext|>
35
lolphp
coredumperror
detq9r5
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>Before 5.4 (I think? Could have been 5.5), you couldn't even *index into* the return value of a function. So if your function returned an array, but you only cared about one element, you...
30
lolphp
ciaranmcnulty
dets67i
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>Surely this title should be "Before 2015 you couldn't..."<|eor|><|eols|><|endoftext|>
13
lolphp
nikic
detw9bo
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>You can, as of PHP 7 ([UVS RFC](https://wiki.php.net/rfc/uniform_variable_syntax)).<|eor|><|eols|><|endoftext|>
13
lolphp
FuckTheCharacterLimi
detj5nx
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>Even just wrapping a function in parentheses gives the same result: <?php $f = function() { echo "LOL PHP"; }; ($f)(); > Output for hhvm-3.12.14 - 3.18.1, 7.0.0 - 7.1.2 >L...
13
lolphp
Liorithiel
detwv23
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>Before 5.4 (I think? Could have been 5.5), you couldn't even *index into* the return value of a function. So if your function returned an array, but you only cared about one element, you...
12
lolphp
the_alias_of_andrea
deug5yc
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>I suppose we should take it as a mark of pride that /r/lolphp is resorting to complaining about things we already fixed. :p<|eor|><|eols|><|endoftext|>
6
lolphp
jesseschalken
deu0s1u
<|sols|><|sot|>Wait, you can't call the return value of a function in one expression<|eot|><|sol|>https://3v4l.org/27QQ7<|eol|><|sor|>Surely this title should be "Before 2015 you couldn't..."<|eor|><|sor|>I think there's a legitimate lolphp here in that it to so long for it to be fixed.<|eor|><|eols|><|endoftext|>
6
lolphp
myaut
5wfyqn
<|sols|><|sot|>Unlike existing PECL libsodium module which uses \Sodium namespace, functions will be renamed to sodium_* for inclusion in 7.2<|eot|><|sol|>https://wiki.php.net/rfc/libsodium<|eol|><|eols|><|endoftext|>
38
lolphp
xiongchiamiov
dea1wup
<|sols|><|sot|>Unlike existing PECL libsodium module which uses \Sodium namespace, functions will be renamed to sodium_* for inclusion in 7.2<|eot|><|sol|>https://wiki.php.net/rfc/libsodium<|eol|><|sor|>To be fair, PHP namespaces are fucking ugly.<|eor|><|eols|><|endoftext|>
23
lolphp
yxpow
deavktp
<|sols|><|sot|>Unlike existing PECL libsodium module which uses \Sodium namespace, functions will be renamed to sodium_* for inclusion in 7.2<|eot|><|sol|>https://wiki.php.net/rfc/libsodium<|eol|><|sor|>To be fair, PHP namespaces are fucking ugly.<|eor|><|sor|>'\' was probably the only free token they could use, since ...
14