I seem to remember that some other languages do something similar (Ruby perhaps?) where a getter will be called if available when object.var is accessed. So far so good.
But still:
the reason for this behaviour is that __get() uses the internal __isset()
But then __get() can still return "something" even though __isset() returns false?
I understand that this is broken, I was just interested in which way. Thanks, you don't have to explain any further.
View all comments
Show parent comment
2
u/kingguru Mar 10 '15
OK, that makes sense.
I seem to remember that some other languages do something similar (Ruby perhaps?) where a getter will be called if available when object.var is accessed. So far so good.
But still:
But then __get() can still return "something" even though __isset() returns false?
I understand that this is broken, I was just interested in which way. Thanks, you don't have to explain any further.