subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
lolphp
DarkMio
7xk8ga
<|sols|><|sot|>Parsing a date string without a day will default the day to 1 - obviously.<|eot|><|sol|>https://bugs.php.net/bug.php?id=69661<|eol|><|eols|><|endoftext|>
9
lolphp
eztab
du9ab6s
<|sols|><|sot|>Parsing a date string without a day will default the day to 1 - obviously.<|eot|><|sol|>https://bugs.php.net/bug.php?id=69661<|eol|><|sor|>This does seem like the only logical behavior. I would expect this. Pretty sure it is the same in other programming languages.<|eor|><|eols|><|endoftext|>
27
lolphp
BadFurDay
du9c3ba
<|sols|><|sot|>Parsing a date string without a day will default the day to 1 - obviously.<|eot|><|sol|>https://bugs.php.net/bug.php?id=69661<|eol|><|sor|>This does seem like the only logical behavior. I would expect this. Pretty sure it is the same in other programming languages.<|eor|><|sor|>Welcome to /r/lolphp<|eor|...
16
lolphp
djxfade
du9z6li
<|sols|><|sot|>Parsing a date string without a day will default the day to 1 - obviously.<|eot|><|sol|>https://bugs.php.net/bug.php?id=69661<|eol|><|sor|>This does seem like the only logical behavior. I would expect this. Pretty sure it is the same in other programming languages.<|eor|><|sor|>I would prefer if it just ...
11
lolphp
Crashmatusow
du9mvqb
<|sols|><|sot|>Parsing a date string without a day will default the day to 1 - obviously.<|eot|><|sol|>https://bugs.php.net/bug.php?id=69661<|eol|><|sor|>This does seem like the only logical behavior. I would expect this. Pretty sure it is the same in other programming languages.<|eor|><|sor|>Pretty sure sql ... oracle...
6
lolphp
kr094
63zgjn
<|sols|><|sot|>The docs for array_search tell you to use array_keys to return >1 matching key. I never knew about search_value<|eot|><|sol|>http://php.net/manual/en/function.array-search.php#refsect1-function.array-search-returnvalues<|eol|><|eols|><|endoftext|>
8
lolphp
MMauro94
5yf4at
<|sols|><|sot|>Type hinting works very well...<|eot|><|sol|>https://3v4l.org/PXt64<|eol|><|eols|><|endoftext|>
10
lolphp
mort96
depi6hz
<|sols|><|sot|>Type hinting works very well...<|eot|><|sol|>https://3v4l.org/PXt64<|eol|><|sor|>Dont do `var_dump` then<|eor|><|sor|>.. but this has nothing to do with var_dump?? It has the exact same issue when using echo: https://3v4l.org/6EeW5. The problem is that PHP 7.0+ and HHVM doesn't throw an error when you'r...
5
lolphp
themusicgod1
4cuz2d
<|sols|><|sot|>yolo crypto<|eot|><|sol|>https://github.com/paragonie/yolocrypto<|eol|><|eols|><|endoftext|>
9
lolphp
carlos_vini
d1lqbs9
<|sols|><|sot|>yolo crypto<|eot|><|sol|>https://github.com/paragonie/yolocrypto<|eol|><|sor|>It's much more fun when README doesn't tell you it's insecure.<|eor|><|eols|><|endoftext|>
7
lolphp
carlos_vini
3x44or
<|soss|><|sot|>Declaration of createFromFormat should be DateTime::createFromFormat ( string $format , string $time [, DateTimeZone $timezone ] ), or maybe not....<|eot|><|sost|>http://php.net/manual/en/datetime.createfromformat.php Nice, it says the signature is: public static DateTime DateTime::createFromFormat...
7
lolphp
ltldvl
3td3hk
<|sols|><|sot|>Bcmath, accepted number format<|eot|><|sol|>https://3v4l.org/MEq9X<|eol|><|eols|><|endoftext|>
7
lolphp
ltldvl
cx54wmc
<|sols|><|sot|>Bcmath, accepted number format<|eot|><|sol|>https://3v4l.org/MEq9X<|eol|><|soopr|>An example when this might bite you, is for example, adding two numbers together, where one might be float. If float gets scientific representation when casted to string the result will we incorrect. Therefore, special care...
11
lolphp
the_alias_of_andrea
cx5m5xr
<|sols|><|sot|>Bcmath, accepted number format<|eot|><|sol|>https://3v4l.org/MEq9X<|eol|><|sor|>Bcmath lets you use arbitrary bases, so I would guess this is probably due to ambiguity about the base of the exponent and confusion between 'e' (mantissa/exponent separator) and 'e' (quintadecimal and higher digit). Anyway,...
9
lolphp
the_alias_of_andrea
cx5q5zm
<|sols|><|sot|>Bcmath, accepted number format<|eot|><|sol|>https://3v4l.org/MEq9X<|eol|><|sor|>Bcmath lets you use arbitrary bases, so I would guess this is probably due to ambiguity about the base of the exponent and confusion between 'e' (mantissa/exponent separator) and 'e' (quintadecimal and higher digit). Anyway,...
7
lolphp
MeLoN_DO
2u48wr
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|eols|><|endoftext|>
8
lolphp
mr-strange
co4yrtk
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>That's perfectly normal in the crazy world of date/time APIs. Can't blame PHP for that one.<|eor|><|eols|><|endoftext|>
23
lolphp
_vec_
co5smsb
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>[deleted]<|eor|><|sor|>[deleted]<|eor|><|sor|>...except for America which uses Sunday as the first day, despite the rest of our calendar con...
17
lolphp
Wouter10123
co5nmd7
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>[deleted]<|eor|><|sor|>[deleted]<|eor|><|sor|>And thus placing half the week*end* right at the beginning of the week. That's some logic for ...
9
lolphp
MeLoN_DO
co52h4k
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>That's perfectly normal in the crazy world of date/time APIs. Can't blame PHP for that one.<|eor|><|soopr|>I understand it is not PHPs fault...
9
lolphp
MeLoN_DO
co4ykky
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|soopr|>* `IntlDateFormatter::parse` is Locale dependant * `IntlCalendar::DOW_*` is not ISO-8601. * `DateTime::createFromFormat` and `strtotime` d...
8
lolphp
OneWingedShark
co6vrme
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>That's perfectly normal in the crazy world of date/time APIs. Can't blame PHP for that one.<|eor|><|soopr|>I understand it is not PHPs fault...
8
lolphp
mr-strange
co51l4v
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>That's perfectly normal in the crazy world of date/time APIs. Can't blame PHP for that one.<|eor|><|soopr|>I understand it is not PHPs fault...
7
lolphp
OneWingedShark
co58idp
<|sols|><|sot|>The first day of the week is dependant on your Locale, thats good But the number associated with each day is too ???<|eot|><|sol|>http://3v4l.org/bO80c<|eol|><|sor|>That's perfectly normal in the crazy world of date/time APIs. Can't blame PHP for that one.<|eor|><|soopr|>I understand it is not PHPs fault...
5
lolphp
jtgarrison
1zkbp5
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
7
lolphp
_vec_
cfumtz6
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
16
lolphp
cies010
cfufft2
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
10
lolphp
tinkermake
cfv7mh6
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
9
lolphp
catcradle5
cfusf01
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
6
lolphp
_vec_
cfv0ogi
<|soss|><|sot|>PHP Alternatives<|eot|><|sost|>I love the idea of using a different language for web programming, but it's just so easy to host php. You don't need a vps, or shell access. Everyone here likes making fun of php so much, what do you use in your personal/professional projects? If I just need to knock out a ...
6
lolphp
tcsavage
1zjgwq
<|sols|><|sot|>This caught me out the other day: "NULL" != NULL but "NULL" == 0<|eot|><|sol|>https://eval.in/111361<|eol|><|eols|><|endoftext|>
6
lolphp
lisp-case
cfv3wwl
<|sols|><|sot|>This caught me out the other day: "NULL" != NULL but "NULL" == 0<|eot|><|sol|>https://eval.in/111361<|eol|><|sor|>You've buried the lead. "NULL" == 0 // this is true 0 == NULL // this is true "NULL" == NULL // this is false That last line? *That's* the punchline. It means that `==` doesn't ...
14
lolphp
catcradle5
cfuscu9
<|sols|><|sot|>This caught me out the other day: "NULL" != NULL but "NULL" == 0<|eot|><|sol|>https://eval.in/111361<|eol|><|sor|>OP, this is because all strings not starting with digits `== 0`. With that context it's not *that* strange.<|eor|><|eols|><|endoftext|>
7
lolphp
tdammers
cfufp15
<|sols|><|sot|>This caught me out the other day: "NULL" != NULL but "NULL" == 0<|eot|><|sol|>https://eval.in/111361<|eol|><|sor|>Sweet `$deity`, are we still not done bashing the `==` operator? Short version: friends don't let friends use `==`. Long version: `==` is OK to use if and only if 1. you are intimately fami...
5
lolphp
terrorobe
13yg7j
<|sols|><|sot|>"Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy." - You can guess what came to my mind.<|eot|><|sol|>http://en.wikipedia.org/wiki/Turing_tarpit<|eol|><|eols|><|endoftext|>
8
lolphp
i-am-am-nice-really
j0jac
<|soss|><|sot|>msqli - the whole thing<|eot|><|sost|>WHY for the love of DOG Object oriented style object mysqli_result::fetch_object ([ string $class_name [, array $params ]] ) Procedural style object mysqli_fetch_object ( mysqli_result $result [, string $class_name [, array $params ]] )<|eost|><|eoss|><|endoftext|>
10
lolphp
ealf
gjib3
<|soss|><|sot|>PHP Fatal error: func_get_args(): Can't be used as a function parameter<|eot|><|sost|>This tells me a bit more than I'd like to know about how function calls are implemented...<|eost|><|eoss|><|endoftext|>
9
lolphp
ealf
c1p3wtz
<|soss|><|sot|>PHP Fatal error: func_get_args(): Can't be used as a function parameter<|eot|><|sost|>This tells me a bit more than I'd like to know about how function calls are implemented...<|eost|><|soopr|>Bonus Guess-the-Output: call_user_func('func_get_args', 42)<|eoopr|><|eoss|><|endoftext|>
5
lolphp
mozillalives
ewoy9
<|sols|><|sot|>is_a() deprecated? true and false<|eot|><|sol|>http://us3.php.net/manual/en/function.is-a.php<|eol|><|eols|><|endoftext|>
8
lolphp
shitcanz
cvlfni
<|sols|><|sot|>PHP array design bares fruit<|eot|><|sol|>https://repl.it/repls/FatherlyRotatingMenus<|eol|><|eols|><|endoftext|>
7
lolphp
shitcanz
ey4xmec
<|sols|><|sot|>PHP array design bares fruit<|eot|><|sol|>https://repl.it/repls/FatherlyRotatingMenus<|eol|><|sor|>Sorry, I fail to see what's the problem here. Maybe the second list is an object instead of an array ?<|eor|><|soopr|>The second list derived from the first is transformed to an object upon json decoding. ...
8
lolphp
shitcanz
ey4x7k3
<|sols|><|sot|>PHP array design bares fruit<|eot|><|sol|>https://repl.it/repls/FatherlyRotatingMenus<|eol|><|sor|>Sorry, I fail to see what's the problem here. Maybe the second list is an object instead of an array ?<|eor|><|soopr|>The second list derived from the first is transformed to an object upon json decoding. ...
6
lolphp
shitcanz
ey4y254
<|sols|><|sot|>PHP array design bares fruit<|eot|><|sol|>https://repl.it/repls/FatherlyRotatingMenus<|eol|><|sor|>Sorry, I fail to see what's the problem here. Maybe the second list is an object instead of an array ?<|eor|><|soopr|>The second list derived from the first is transformed to an object upon json decoding. ...
6
lolphp
MazeChaZer
8ha51c
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|eols|><|endoftext|>
5
lolphp
farsightxr20
dyi9cqy
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|sor|>I mean, you asked for this behavior by passing "true" as the second argument. Omit that and things work as expected.<|eor|><|eols|><|endoftext|>
23
lolphp
andsens
dyib6bf
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|soopr|>To be honest, this is probably a smaller lolphp, but the fact that they mixed lists and hash maps really grinds my gears. Also, this is just one little example of the ma...
15
lolphp
SaraMG
dyjbkjm
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|sor|>is_array((array)(new stdClass)) === true OMG, SCANDAL!!!!<|eor|><|eols|><|endoftext|>
14
lolphp
AyrA_ch
dyija7m
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|sor|>I mean, you asked for this behavior by passing "true" as the second argument. Omit that and things work as expected.<|eor|><|soopr|>So as soon as I pass true JSON serializ...
13
lolphp
farsightxr20
dyievs0
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|sor|>I mean, you asked for this behavior by passing "true" as the second argument. Omit that and things work as expected.<|eor|><|soopr|>So as soon as I pass true JSON serializ...
12
lolphp
Freeky
dyie3il
<|sols|><|sot|>Sure, just use one data structure for both lists and hash maps, what could go wrong?<|eot|><|sol|>https://3v4l.org/R9J4u<|eol|><|soopr|>To be honest, this is probably a smaller lolphp, but the fact that they mixed lists and hash maps really grinds my gears. Also, this is just one little example of the ma...
7
lolphp
daxim
5ym904
<|sols|><|sot|>PHP syntax is version and context dependent<|eot|><|sol|>http://blogs.perl.org/users/ron_savage/2017/03/off-topic-php-syntax-is-version-context-dependent.html<|eol|><|eols|><|endoftext|>
7
lolphp
nikic
derdcht
<|sols|><|sot|>PHP syntax is version and context dependent<|eot|><|sol|>http://blogs.perl.org/users/ron_savage/2017/03/off-topic-php-syntax-is-version-context-dependent.html<|eol|><|sor|>Oh my god! Are you saying newer language versions allow more syntax?! Who would've thought...<|eor|><|eols|><|endoftext|>
22
lolphp
okamy
der78uw
<|sols|><|sot|>PHP syntax is version and context dependent<|eot|><|sol|>http://blogs.perl.org/users/ron_savage/2017/03/off-topic-php-syntax-is-version-context-dependent.html<|eol|><|sor|>This behaviour is explained in php 5.6 changelog, see constant expression. http://php.net/manual/en/migration56.new-features.php <|e...
18
lolphp
bj_christianson
deratje
<|sols|><|sot|>PHP syntax is version and context dependent<|eot|><|sol|>http://blogs.perl.org/users/ron_savage/2017/03/off-topic-php-syntax-is-version-context-dependent.html<|eol|><|sor|>This behaviour is explained in php 5.6 changelog, see constant expression. http://php.net/manual/en/migration56.new-features.php <|e...
8
lolphp
duskwuff
derjlgq
<|sols|><|sot|>PHP syntax is version and context dependent<|eot|><|sol|>http://blogs.perl.org/users/ron_savage/2017/03/off-topic-php-syntax-is-version-context-dependent.html<|eol|><|sor|>You need to declare strict_type for PHP70 and PHP71 to enable type checking<|eor|><|sor|>This has nothing to do with type checking.<|...
5
lolphp
cbraga
48ud9m
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|eols|><|endoftext|>
7
lolphp
Liorithiel
d0mnswu
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|sor|>Not lolphp. This kind of compiler is pretty common in programming languages. Javascript has several (e.g. [Traceu...
15
lolphp
masklinn
d0r811f
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|sor|>Not lolphp. This kind of compiler is pretty common in programming languages. Javascript has several (e.g. [Traceu...
8
lolphp
allthediamonds
d133hxy
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|sor|>Not lolphp. This kind of compiler is pretty common in programming languages. Javascript has several (e.g. [Traceu...
7
lolphp
nej_simon
d0tokwv
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|sor|>Not lolphp. This kind of compiler is pretty common in programming languages. Javascript has several (e.g. [Traceu...
5
lolphp
nej_simon
d0uj7lr
<|sols|><|sot|>Thanks to the PHP 7 to PHP 5.6 Transpiler no one needs to bother with updating their servers. Isn't open source wonderful? ^_^<|eot|><|sol|>https://github.com/jaytaph/Transphpile<|eol|><|sor|>Not lolphp. This kind of compiler is pretty common in programming languages. Javascript has several (e.g. [Traceu...
5
lolphp
polish_niceguy
21ct7x
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|eols|><|endoftext|>
8
lolphp
wung
cgbt3m2
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>Correct: Why not. The empty string is a valid string. This is a good feature.<|eor|><|eols|><|endoftext|>
16
lolphp
Drainedsoul
cgbwbfl
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>I hate to come to PHP's defense, but this is exceptionally sane behaviour.<|eor|><|eols|><|endoftext|>
14
lolphp
graingert
cgbsopr
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>You can do this with python: u0_a154@hammerhead:/ $ python Python 2.7.2 (default, Mar 4 2014, 22:56:02) [GCC 4.6 20120106 (prerelease)] on linux2 Type "help", "copyright", "credit...
12
lolphp
ealf
cgdk3n4
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>I hate to come to PHP's defense, but this is exceptionally sane behaviour.<|eor|><|sor|>Well, if it was consistent. If you have an object (which is the only way to get a dictionary where you can u...
10
lolphp
wung
cgbu7s4
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>Correct: Why not. The empty string is a valid string. This is a good feature.<|eor|><|soopr|>Any reasonable use case?<|eoopr|><|sor|>The use case is just as reasonable as an non-empty string. Of c...
9
lolphp
wung
cgbu5p1
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>Correct: Why not. The empty string is a valid string. This is a good feature.<|eor|><|soopr|>Any reasonable use case?<|eoopr|><|sor|>The use case is just as reasonable as an non-empty string. Of c...
8
lolphp
infinull
cgbwe10
<|sols|><|sot|>Constant name can be an empty string. Because why not?<|eot|><|sol|>http://codepad.org/J6gYgrc3<|eol|><|sor|>You can do this with python: u0_a154@hammerhead:/ $ python Python 2.7.2 (default, Mar 4 2014, 22:56:02) [GCC 4.6 20120106 (prerelease)] on linux2 Type "help", "copyright", "credit...
6
lolphp
vytah
zrljx
<|soss|><|sot|>Guess the output: var_dump(1.0/0.0);<|eot|><|sost|> PHP Warning: Division by zero in - on line 1 bool(false)<|eost|><|eoss|><|endoftext|>
5
lolphp
vytah
c6778up
<|soss|><|sot|>Guess the output: var_dump(1.0/0.0);<|eot|><|sost|> PHP Warning: Division by zero in - on line 1 bool(false)<|eost|><|sor|>How is this weird? I'd expect a division by zero error.<|eor|><|soopr|>But would you expect `1.0/0.0 === false` ?<|eoopr|><|eoss|><|endoftext|>
11
lolphp
poizan42
c6797qy
<|soss|><|sot|>Guess the output: var_dump(1.0/0.0);<|eot|><|sost|> PHP Warning: Division by zero in - on line 1 bool(false)<|eost|><|sor|>How is this weird? I'd expect a division by zero error.<|eor|><|sor|>I'd expect either Inf or an error - no a warning and false...<|eor|><|eoss|><|endoftext|>
10
lolphp
matjoeman
c676jvs
<|soss|><|sot|>Guess the output: var_dump(1.0/0.0);<|eot|><|sost|> PHP Warning: Division by zero in - on line 1 bool(false)<|eost|><|sor|>How is this weird? I'd expect a division by zero error.<|eor|><|eoss|><|endoftext|>
8
lolphp
poizan42
u06u6
<|soss|><|sot|>Not a php wtf, but what the hell has happened to the css here?<|eot|><|sost|>Created by nobody, no moderators, every username invisible? &nbsp; - or more specifically this odd css rule: .author { display: none } dafuq?<|eost|><|eoss|><|endoftext|>
9
lolphp
hahainternet
c4r7cyg
<|soss|><|sot|>Not a php wtf, but what the hell has happened to the css here?<|eot|><|sost|>Created by nobody, no moderators, every username invisible? &nbsp; - or more specifically this odd css rule: .author { display: none } dafuq?<|eost|><|sor|>I think the point is to ignore the user and focus on PHP's faults...
17
lolphp
ealf
c4rqc8e
<|soss|><|sot|>Not a php wtf, but what the hell has happened to the css here?<|eot|><|sost|>Created by nobody, no moderators, every username invisible? &nbsp; - or more specifically this odd css rule: .author { display: none } dafuq?<|eost|><|sor|>This is a support group for people who use PHP against their will...
8
lolphp
suprfsat
c510foi
<|soss|><|sot|>Not a php wtf, but what the hell has happened to the css here?<|eot|><|sost|>Created by nobody, no moderators, every username invisible? &nbsp; - or more specifically this odd css rule: .author { display: none } dafuq?<|eost|><|sor|>I think the point is to ignore the user and focus on PHP's faults...
8
lolphp
samhorwitz
qcic9
<|sols|><|sot|>Okay so I get these are deprecated timezone strings and whatever, but seriously PHP? You have EST and MST, but not CST and PST? But you do have all four in DST form?<|eot|><|sol|>http://www.php.net/manual/en/timezones.others.php<|eol|><|eols|><|endoftext|>
7
lolphp
Rhomboid
c3wi4f7
<|sols|><|sot|>Okay so I get these are deprecated timezone strings and whatever, but seriously PHP? You have EST and MST, but not CST and PST? But you do have all four in DST form?<|eot|><|sol|>http://www.php.net/manual/en/timezones.others.php<|eol|><|sor|>CST could mean any of: - (US) Central Standard Time (UTC-6:00)...
12
lolphp
ealf
hbryk
<|soss|><|sot|>class X { function f($v) { var_dump($$v); } } $x = new X(); $x->f('this');<|eot|><|sost|><|eost|><|eoss|><|endoftext|>
7
lolphp
ealf
c1u5pok
<|soss|><|sot|>class X { function f($v) { var_dump($$v); } } $x = new X(); $x->f('this');<|eot|><|sost|><|eost|><|soopr|>Buggy perf hack; if `$this` isn't referenced (statically), it's never added to the symbol table. Adding $this; or even if(0) $this; makes it reappear. `compact()` runs into the same probl...
5
lolphp
rweir
gv3k2
<|sols|><|sot|>xmlrpc code injection [old but classic]<|eot|><|sol|>http://jerub.livejournal.com/68408.html<|eol|><|eols|><|endoftext|>
6
lolphp
ealf
ejdds
<|sols|><|sot|>PHP doesn't need 'finally' because dropping the exception on the floor "is absolutely equivalent"<|eot|><|sol|>http://bugs.php.net/bug.php?id=32100<|eol|><|eols|><|endoftext|>
8
lolphp
ealf
dtooa
<|soss|><|sot|>There is no super, only static calls that preserve $this<|eot|><|sost|> class A { function foo() { if ($this instanceof UnrelatedClass) echo "WTF?"; return $this; } } class Subclass extends A { function foo() { return parent::foo(); return A::f...
7
lolphp
Takeoded
4fn88m
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|eols|><|endoftext|>
5
lolphp
tdammers
d2ab1il
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>E_ALL means "report many kinds of errors, but not all". If you want "actually literally all kinds of errors, then in my experience your best bet is to use `~0`.<|eor|><|soopr|>doesn't make a difference in this code though.<|...
21
lolphp
tdammers
d2a986p
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>E_ALL means "report many kinds of errors, but not all". If you want "actually literally all kinds of errors, then in my experience your best bet is to use `~0`.<|eor|><|eols|><|endoftext|>
16
lolphp
chimyx
d2bjla9
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>[Well, it *becomes* an array](https://3v4l.org/RgeLu)<|eor|><|eols|><|endoftext|>
7
lolphp
rinyre
d2agcme
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>Take this a step further with variable variables: https://3v4l.org/49udB There's no means I can find by which to reference $$a directly, then, as one might typically use variable variables.<|eor|><|eols|><|endoftext|>
6
lolphp
Yamitenshi
d2tr5yz
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>E_ALL means "report many kinds of errors, but not all". If you want "actually literally all kinds of errors, then in my experience your best bet is to use `~0`.<|eor|><|soopr|>doesn't make a difference in this code though.<|...
6
lolphp
Takeoded
d2a9m2m
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>E_ALL means "report many kinds of errors, but not all". If you want "actually literally all kinds of errors, then in my experience your best bet is to use `~0`.<|eor|><|soopr|>doesn't make a difference in this code though.<|...
5
lolphp
foobar5678
d2at1yq
<|sols|><|sot|>can somebody explain this shit?<|eot|><|sol|>https://3v4l.org/2QoD6<|eol|><|sor|>PHP lets you implicitly create arrays if there's no such variable or it is set to `null`. This is arguably quite useful, it's more convenient than manually creating each dimension yourself.<|eor|><|sor|>But how do you even k...
5
lolphp
shitbangs
2cu90d
<|sols|><|sot|>Was trying to implement ArrayAccess, then this happened<|eot|><|sol|>http://imgur.com/2woBLlF<|eol|><|eols|><|endoftext|>
7
lolphp
shitbangs
cjj2vie
<|sols|><|sot|>Was trying to implement ArrayAccess, then this happened<|eot|><|sol|>http://imgur.com/2woBLlF<|eol|><|soopr|>Without reading the source, this is what seems to be happening: Array offsets are converted to integer if they're considered numeric, while object property specifiers are always converted to stri...
10
lolphp
jrh3k5
cjj3kzi
<|sols|><|sot|>Was trying to implement ArrayAccess, then this happened<|eot|><|sol|>http://imgur.com/2woBLlF<|eol|><|soopr|>Without reading the source, this is what seems to be happening: Array offsets are converted to integer if they're considered numeric, while object property specifiers are always converted to stri...
8
lolphp
OneWingedShark
cjj4i73
<|sols|><|sot|>Was trying to implement ArrayAccess, then this happened<|eot|><|sol|>http://imgur.com/2woBLlF<|eol|><|soopr|>Without reading the source, this is what seems to be happening: Array offsets are converted to integer if they're considered numeric, while object property specifiers are always converted to stri...
6
lolphp
aleczapka
1bxjfk
<|soss|><|sot|>Hmm.. shouldn't is_array() check for instanceof ArrayAccess ?<|eot|><|sost|>I find it kinda odd that is_array() does not check for instance of ArrayAccess. If you introduce collection like object in your code, you gotta recheck all of in_array() usage and change it to: if (is_array($input) || $input...
6
lolphp
martindines
c9b3put
<|soss|><|sot|>Hmm.. shouldn't is_array() check for instanceof ArrayAccess ?<|eot|><|sost|>I find it kinda odd that is_array() does not check for instance of ArrayAccess. If you introduce collection like object in your code, you gotta recheck all of in_array() usage and change it to: if (is_array($input) || $input...
10
lolphp
ioctl79
c9bel45
<|soss|><|sot|>Hmm.. shouldn't is_array() check for instanceof ArrayAccess ?<|eot|><|sost|>I find it kinda odd that is_array() does not check for instance of ArrayAccess. If you introduce collection like object in your code, you gotta recheck all of in_array() usage and change it to: if (is_array($input) || $input...
6
lolphp
huf
n4pur
<|soss|><|sot|>guess what var_dump(unset($a)); outputs...<|eot|><|sost|><|eost|><|eoss|><|endoftext|>
6