Bug #76257 [NEW]: NULL can be used as an array without essay
| From: | smileytechguy at smileytechguy dot com | Date: | Mon, 23 Apr 2018 21:01:03 +0000 |
| Subject: | Bug #76257 [NEW]: NULL can be used as an array without essay | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-214855@lists.php.net to get a copy of this message | ||
From: smileytechguy at smileytechguy dot com
Operating system: Windows 10
PHP version: 7.2.4
Package: Arrays related
Bug Type: Bug
Bug description:NULL can be used as an array without essay
Description:
------------
The special constant NULL or any value which is null can be used as an
array without error, warning, or notice.
PHP version:
PHP 7.2.4 (cli) (built: Mar 28 2018 04:27:01) ( ZTS MSVC15 (Visual C++
2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Test script:
---------------
$foo = NULL;
var_dump($foo[0]); // will output NULL
var_dump($foo["bar"]); // will also output NULL
Expected result:
----------------
Throw at least a warning, showing that NULL was used in an invalid way.
Actual result:
--------------
NULL is returned
--
Edit bug report at https://bugs.php.net/bug.php?id=76257&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76257&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76257&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76257&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76257&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76257&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76257&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76257&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76257&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76257&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76257&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76257&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76257&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76257&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76257&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76257&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76257&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76257&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76257&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76257&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76257&r=mysqlcfg