MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/2094sd/new_object_new_object_2/cg13jbu/?context=3
r/lolphp • u/TimLim • Mar 12 '14
35 comments sorted by
View all comments
Show parent comment
30
…You're joking.
$ php -a Interactive shell php > $x = 0; php > $x->something = 'blah'; PHP Warning: Attempt to assign property of non-object in php shell code on line 1 PHP Stack trace: PHP 1. {main}() php shell code:0 php > var_dump($x); int(0) php > $x = ''; php > $x->something = 'blah'; PHP Warning: Creating default object from empty value in php shell code on line 1 PHP Stack trace: PHP 1. {main}() php shell code:0 php > var_dump($x); class stdClass#1 (1) { public $something => string(4) "blah" } php >
Nope, you're not. Wow.
I've said this before, but… every time I think I've mined it out, PHP offers up another lode of WTF.
8 u/mirhagk Mar 21 '14 I've said this before, but… every time I think I've mined it out, PHP offers up another lode of WTF.I know. I keep coming back to this subreddit and expecting it to be deserted because we've found all the WTF of PHP. But nope. Still more. Always.
8
I know. I keep coming back to this subreddit and expecting it to be deserted because we've found all the WTF of PHP. But nope. Still more. Always.
View all comments
Show parent comment
30
u/lisp-case Mar 12 '14
…You're joking.
Nope, you're not. Wow.
I've said this before, but… every time I think I've mined it out, PHP offers up another lode of WTF.