note 86193 deleted from function.return by googleguy

From: Date: Thu, 02 Jan 2014 23:18:56 +0000
Subject: note 86193 deleted from function.return by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-198092@lists.php.net to get a copy of this message
Note Submitter: list at regularoddity dot com ---- As obvious as it may seem, it might still be useful to point out that return called without any value returns null. <?php function test() { return; } print gettype(test()) . "\n"; print (test()?'true':'false') . "\n"; print (!test()?'true':'false') . "\n"; print (test() === false?'true':'false') . "\n"; ?> This returns: NULL false true false

« previous php.notes (#198092) next »