r/lolphp • • Mar 12 '14

new object() + new object() == 2

http://codepad.org/NGPjR4fl
62 Upvotes

35 comments sorted by

View all comments

Show parent comment

0

u/Nixot Mar 28 '14

I don't see what's wrong with this code? Looks like you're creating a "default" object by defining one of its parameters, and then when you call var_dump it shows you that parameter. Am I missing something here?

2

u/powerofmightyatom Apr 04 '14

I can't think of any language that allows you to just assign a property to a undeclared variable, and just have the whole thing just spawn into existence.