|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-06-21 07:53 UTC] jsgoupil at lookstrike dot com
Description: ------------ When I check an isset of a variable that contain text I receive an error ONLY when i check the last+1 char... NOTE: Working properly on php4.3.6 Reproduce code: --------------- <?php $test = "s"; if(isset($test[1])) echo "OK"; else echo "ERROR"; ?> Expected result: ---------------- It supposed to return "ERROR" because $test[1] is not existing (in real, there is a \0 in C++ but in php, we are not supposed to see it). (working fine in php4.3.6) Actual result: -------------- We currently get "OK" If we do an isset of $test[2], we get an error... Obviously, php check the \0 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 08:00:01 2025 UTC |
It is the same with $test{1} And you can also try with negative values. echo intval(isset($test{-1})); will return 1 (supposed to be 0)