#42575 [Opn->Bgs]: Access to undefined array index doesn't generate a notice
| From: | johannes@php.net | Date: | Thu, 06 Sep 2007 10:38:28 +0000 |
| Subject: | #42575 [Opn->Bgs]: Access to undefined array index doesn't generate a notice | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-117211@lists.php.net to get a copy of this message | ||
ID: 42575
Updated by: johannes@php.net
Reported By: adamrbar at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Class/Object related
Operating System: Windows Vista
PHP Version: 5.2.4
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2007-09-06 10:30:00] adamrbar at gmail dot com
Description:
------------
I have a class with simple property, without any given type or value.
Trying to access this property as it will be an array (i.e. getting its
index, which is obviously undefined), should generate a notice when
E_STRICT is set - but it doesn't. Specifying the property type as array
or adding other index generates notice as expected.
Reproduce code:
---------------
error_reporting(E_ALL | E_STRICT);
class test
{
private $bla;
public function __construct()
{
var_dump(empty($this->bla));
var_dump($this->bla['fff']);
}
}
$x = new test();
Expected result:
----------------
bool(true)
Notice: Undefined index: fff in [...]
NULL
Actual result:
--------------
bool(true)
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42575&edit=1