#27443 [Opn->Csd]: defined() wrong return type

From: Date: Mon, 01 Mar 2004 08:05:15 +0000
Subject: #27443 [Opn->Csd]: defined() wrong return type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55723@lists.php.net to get a copy of this message
ID: 27443 Updated by: derick@php.net Reported By: talmage at cableone dot net -Status: Open +Status: Closed Bug Type: Unknown/Other Function Operating System: Debian Linux PHP Version: 4.3.4 New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2004-03-01 01:40:02] talmage at cableone dot net Description: ------------ defined() does not return boolean, it returns an integer according to gettype() If you do a gettype() on isset(), it returns the type as boolean. If you do a gettype() on defined() it returns an integer. The docs state defined() returns boolean and it makes logical sense to have defined() return boolean type. Reproduce code: --------------- echo gettype(isset($test)); echo "<br>"; echo gettype(defined("test")); Expected result: ---------------- boolean boolean Actual result: -------------- boolean integer ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27443&edit=1

« previous php.bugs (#55723) next »