Bug #14066 Updated: Can't suppress warnigns on accessing invalid string offset

From: Date: Sun, 03 Mar 2002 22:47:39 +0000
Subject: Bug #14066 Updated: Can't suppress warnigns on accessing invalid string offset
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-1577@lists.php.net to get a copy of this message
ID: 14066 Updated by: derick@php.net -Summary: Can't suppress warnigns on accessing invalid string offset Reported By: mfischer@guru.josefine.at -Status: Open +Status: Suspended Bug Type: Scripting Engine problem Operating System: Any PHP Version: 4.0CVS-2001-11-15 New Comment: It's an engine thing, and can really not be fixed. The accessing of the {3} is done after the END_SILENCE op at the CONCAT op. I'll mark it as suspended for now. Previous Comments: ------------------------------------------------------------------------ [2002-03-03 17:35:33] mfischer@php.net I'm not satisfied with this answer :-) Why does it work with arrays but not with strings (and, bert, yeah I know they aren't the same). Just because "it's strings here" doesn't legitimate that a warnings is thrown. Using your suggestion is rather cumbersome. Is it an implemention issue? Can it be solve to be less long winded? "it is" a bug imho :) ------------------------------------------------------------------------ [2002-03-03 17:35:31] mfischer@php.net I'm not satisfied with this answer :-) Why does it work with arrays but not with strings (and, bert, yeah I know they aren't the same). Just because "it's strings here" doesn't legitimate that a warnings is thrown. Using your suggestion is rather cumbersome. Is it an implemention issue? Can it be solve to be less long winded? "it is" a bug imho :) ------------------------------------------------------------------------ [2002-03-03 17:28:03] derick@php.net It's not a bug, $foo{3}. "\n" is done before the @, so that displays the error. so I'm closing this, this works BTW: $foo = "foo"; echo @($foo{3}. "\n"); Derick ------------------------------------------------------------------------ [2001-12-02 17:06:21] mfischer@php.net One more, this change happened in Zend/zend_execute.c line 103. ------------------------------------------------------------------------ [2001-12-02 17:04:40] mfischer@php.net Btw, this breaks BC: [chroot] mfischer@ficken:~/isrc/cvs/php4/Zend$ php -v 4.0.6-dev [chroot] mfischer@ficken:~/isrc/cvs/php4/Zend$ php -q <? error_reporting(E_ALL); $foo = ''; isset($foo[2]);?> [chroot] mfischer@ficken:~/isrc/cvs/php4/Zend$ and with RC4: mfischer@ficken:~/isrc/cvs/php4/Zend$ php -v 4.1.0RC4 mfischer@ficken:~/isrc/cvs/php4/Zend$ php -q <? error_reporting(E_ALL); $foo = ''; isset($foo[2]);?> <br> <b>Warning</b>: Uninitialized string offset: 2 in <b>-</b> on line <b>1</b><br> -(1) : Warning - Uninitialized string offset: 2 mfischer@ficken:~/isrc/cvs/php4/Zend$ Marking as critical. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/14066 -- Edit this bug report at http://bugs.php.net/?id=14066&edit=1

« previous php.bugs (#1577) next »