[PHP-BUG] Bug #74344 [NEW]: isset() returns inncorect value
[email protected] ("damianboni at gmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
From: damianboni at gmail dot com
Operating system: ubuntu 16.04.3
PHP version: 7.0.17
Package: Scripting Engine problem
Bug Type: Bug
Bug description:isset() returns inncorect value
Description:
------------
Tested on PHP7.0.8 ubuntu 16.04.3 @ 2017-03-30
isset() is incorrectly retuning false (should return true) when checking
array key that has its value set to boolean.
I tested the below script on different version of PHP and always get
true with an exception to 7.0.8
Test script:
---------------
Code:
$params['entry']['attributes'] = array(
'enabled' => true
);
var_dump(isset($params['entry']['attributes']['enabled']));
$whatIsGoingOn = $params['entry']['attributes']['enabled'];
var_dump(isset($whatIsGoingOn));
var_dump(array_key_exists('enabled', $params['entry']['attributes']));
Output:
bool(false)
bool(true)
bool(true)
Expected result:
----------------
bool(true)
bool(true)
bool(true)
Actual result:
--------------
bool(false)
bool(true)
bool(true)
--
Edit bug report at https://bugs.php.net/bug.php?id=74344&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74344&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74344&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74344&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74344&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74344&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74344&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74344&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74344&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74344&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74344&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74344&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74344&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74344&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74344&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74344&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74344&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74344&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74344&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74344&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74344&r=mysqlcfg