|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-30 10:24 UTC] php at ert dot org dot ua
Description: ------------ When I try to index some scalar value (integer, for example), I want to get error message, but I have normal NULL result. Reproduce code: --------------- <? error_reporting(0xFFFFFFFF); $a = 1; if ($a[5]) echo 'yes'; else echo 'no'; ?> Expected result: ---------------- Error, warning or notice Actual result: -------------- no PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 10:00:01 2025 UTC |
Accessing offsets is only supported for strings and arrays. As the manual states: "Accessing by [] or {} to variables of other type silently returns NULL." See also http://php.net/language.types.string and bug #41195.