From:             adamrbar at gmail dot com
Operating system: Windows Vista
PHP version:      5.2.4
PHP Bug Type:     Class/Object related
Bug description:  Access to undefined array index doesn't generate a notice

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 bug report at http://bugs.php.net/?id=42575&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42575&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42575&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42575&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42575&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42575&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42575&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42575&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42575&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42575&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42575&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42575&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42575&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42575&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42575&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42575&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42575&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42575&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42575&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42575&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42575&r=mysqlcfg

Reply via email to