#37676 [Opn]: using Array access operator [] on boolean variable does not show Notice

From: Date: Fri, 02 Jun 2006 11:25:00 +0000
Subject: #37676 [Opn]: using Array access operator [] on boolean variable does not show Notice
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97974@lists.php.net to get a copy of this message
 ID:               37676
 Updated by:       tony2001@php.net
 Reported By:      tgross at m-s dot de
 Status:           Open
-Bug Type:         Arrays related
+Bug Type:         Feature/Change Request
 Operating System: Windows XP
 PHP Version:      5.1.4
 New Comment:

Reclassified as feature request.


Previous Comments:
------------------------------------------------------------------------

[2006-06-02 11:21:51] tgross at m-s dot de

Description:
------------
When trying to access an array using an undefined offset, PHP displays
an Notice.

However, when you access a boolean variable with any combination of the
array operator [], PHP just returns NULL and displays no error message.

Reproduce code:
---------------
error_reporting (E_ALL);
$a = false;

var_dump ($a[5]);
var_dump ($a['test'][-3]);


Expected result:
----------------
PHP should display a Notice or a Warning.

Actual result:
--------------
PHP displays
NULL NULL


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37676&edit=1


Thread (11 messages)

« previous php.bugs (#97974) next »