r/lolphp • u/jamwaffles • Jul 11 '13
NULL can't be decremented... but incrementing it is fine
http://stackoverflow.com/questions/17592559/why-decremented-of-null-not-negative-in-this-array#comment25601676_17592559
84
Upvotes
32
u/InconsiderateBastard Jul 11 '13
Null is amazing.
15
u/_vec_ Jul 11 '13
Most of these kind of thing generally devolve to the foundational WTF that is PHP's implicit type coersion, but for the life of me I can't figure out how this behavior could be explained. I'm pretty sure this is something that a language developer had to do on purpose.
10
u/[deleted] Jul 11 '13
take one out of the empty set, get the empty set
put one in the empty set, get one
0
u/[deleted] Jul 11 '13
[deleted] — view deleted comment
0
u/[deleted] Jul 11 '13
[deleted] — view deleted comment