|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27443 defined() wrong return type
Submitted: 2004-03-01 01:40 UTC Modified: 2004-03-01 03:05 UTC
Avg. Score:2.7 ± 1.7
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: talmage at cableone dot net
New email:
PHP Version: OS:


 [2004-03-01 01:40 UTC] talmage at cableone dot net
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-01 03:05 UTC]
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
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 29 21:01:30 2024 UTC