ID:               15737
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
-Bug Type:         Compile Warning
+Bug Type:         Strings related
 Operating System: Win32 / Linux
 PHP Version:      4.1.1
 New Comment:

The issues is not isset().  PHP generates an warning when attempting to
access a string subscript that does not exist.

If the level error reporting is set to E_ALL, this warning will be
generated. 

A better way to do this would be to use strlen().


Previous Comments:
------------------------------------------------------------------------

[2002-02-26 13:52:05] [EMAIL PROTECTED]

<?php
function test($foo = 'bar')
{       
        for($i=0; $i<5; $i++)
        {
                !isset($foo[$i]) ? $foo[$i] = 0 : 0;
                
                echo $foo[$i];
        }
}

test();
?>

works fine on 4.0.6; 4.1.1 (linux and win32) announces

"Uninitialized string offset on line 6..."


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=15737&edit=1

Reply via email to