Regarding object casting

From: Date: Mon, 02 Dec 2013 12:19:52 +0000
Subject: Regarding object casting
Groups: php.internals 
Request: Send a blank email to internals+get-70466@lists.php.net to get a copy of this message
Good day, PHP internals folks.

As we all know, objects in PHP casts to true by default, except one
particular class - SimpleXML objects created from empty tag.

Many people in the community has had a problem with this limitation (or
lack of functionality) to be able to set cast value of the object and are
exploiting the SimpleXML to achieve the ability to control object casting.

The question would be, why this exception - SimpleXML? Could we have a
magic method or other way to control how object is being casted?

Thoughts?

Thanks.


Thread (3 messages)

« previous php.internals (#70466) next »