Edit report at https://bugs.php.net/bug.php?id=37676&edit=1
ID: 37676 Comment by: svodev at gmail dot com Reported by: tgross at m-s dot de Summary: using Array access operator [] on boolean variable does not show Notice Status: Open Type: Feature/Change Request Package: Scripting Engine problem Operating System: * PHP Version: * Block user comment: N Private report: N New Comment: The same issue is with NULL values; $a = NULL; echo $a['b']; ...and nothing happen Previous Comments: ------------------------------------------------------------------------ [2006-06-02 11:25:00] tony2...@php.net Reclassified as feature request. ------------------------------------------------------------------------ [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 https://bugs.php.net/bug.php?id=37676&edit=1