Right now, the following produces a warning when using
error_reporting(E_ALL) which can only be catched with ob_start():

<?
$string = "foo";
echo $string[3] . "\n";
?>

gives

-(1) : Warning - Uninitialized string offset:  3

Is it really necessary to always first check the length before
accessing a certain offset? Wouldn't just returning an empty
string be enough? I.e., just remove the warning in
Zend/zend_execute.c:103 ?


Btw, is $string{$offset} documented anywhere? Derick already told
me its not but then its in PHP since a long time. Is $string{$offset}
really faster but not well-tested? I've already even seen it in a
PEAR package (Console/Getopt.php from Andrei).

- Markus

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to