PHP :: Bug #27443 :: defined() wrong return type
- ️Mon Mar 01 2004
Bug #27443 | defined() wrong return type | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Submitted: | 2004-03-01 01:40 UTC | Modified: | 2004-03-01 03:05 UTC |
|
||||||||||
From: | talmage at cableone dot net | Assigned: | ||||||||||||
Status: | Closed | Package: | Unknown/Other Function | |||||||||||
PHP Version: | 4.3.4 | OS: | Debian Linux | |||||||||||
Private report: | No | CVE-ID: | None |
[2004-03-01 01:40 UTC] 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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commitsRelated reports
[2004-03-01 03:05 UTC] derick@php.net
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.