>> print $a[0];   // prints 5
>> print $a[100]; // Notice: Uninitialized string offset:  100
Yup, this should happen when 5 is treated as an array of characters.
In other words as a string.
$a = '5';
echo $a[0];
echo $a[100];
gives you the expected result

regarding the original question, i think that the interpreter is
prefilling the variable with null

$a = 5;

since $a[0] is already assigned (to null) the interpreter is not
throwing a notice

$b = null;

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to