php - Is it possible to make an object return false by default? -


I tried to ask this before, and messed up the question, so I will try again. Is it possible to lie false to an object return when the event is kept in the statement? What do I need:

  $ dog = new DogObject (); If ($ dog) {return "this is bad;" } And {return "Excellent! $ Dog was false!" }  

Is this possible? It is not absolutely necessary, but will save me some lines of code. Thanks!

No, PHP has no support for operator overloading. Maybe they'll add it to the future version.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -