Req #69594 [Opn]: magic isNull method for objects (like toString)

From: Date: Thu, 07 May 2015 17:01:13 +0000
Subject: Req #69594 [Opn]: magic isNull method for objects (like toString)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192552@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69594&edit=1 ID: 69594 Updated by: cmb@php.net Reported by: di3 at gmx dot net Summary: magic isNull method for objects (like toString) Status: Open Type: Feature/Change Request Package: Class/Object related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The request is related to request #43909. Somewhat related is also the Nullsafe Calls RFC: <https://wiki.php.net/rfc/nullsafe_calls>. I wonder when this magic method shall be triggered. Only when used with isset, empty and is_null, or more generally in boolean context. If the latter, it is also related to request #69486. Previous Comments: ------------------------------------------------------------------------ [2015-05-07 13:28:31] di3 at gmx dot net Description: ------------ add a magic null method for objects (like __toString) to check if object is_null or empty. public function __isNull() return true or false many using null objects to get a secure returnvalue would be nice a object representate null is comparable. same for empty ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69594&edit=1

« previous php.bugs (#192552) next »