Re: Fix for #39018 (suppressing error messages)
| From: | Felipe Pena | Date: | Fri, 07 Mar 2008 15:43:27 +0000 |
| Subject: | Re: Fix for #39018 (suppressing error messages) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36048@lists.php.net to get a copy of this message | ||
Hello,
no reply means "no! don't touch." ?
Thanks.
2008/3/3, Felipe Pena <felipensp@gmail.com>:
> Hello developers,
>
> I made a patch for the bug#39018:
>
> $x = 'test';
> @$x[4] == 'a';
> (@$x[4]) == 'a';
> (@($x[4])) == 'a';
> @($x[4]) == 'a';
> $foo = 'test'; $x = @$foo[6];
>
> Actually, all cases above shows E_NOTICE.
> With the patch, E_NOTICE is not showed.
>
> Patches:
> [5.3] http://felipe.ath.cx/diff/bug39018.diff
> [HEAD] http://felipe.ath.cx/diff/bug39018-HEAD.diff
>
>
>
> However, this patch breaks one test in Zend/tests/, because of an
> E_NOTICE:
>
> --TEST--
> Bug #39304 (Segmentation fault with list unpacking of string offset)
> --FILE--
> <?php
> $s = "";
> list($a, $b) = $s[0];
> ?>
> --EXPECTF--
> Fatal error: Cannot use string offset as an array in %sbug39304.php on
> line 3
>
> Diff:
> 001+ Notice: Uninitialized string offset: 0 ...
>
>
>
> Would be this a problem? Looks right to me...
>
> Finally, any objection?
>
>
> Tests for the this fix:
> - http://felipe.ath.cx/diff/bug39018.phpt
> - http://felipe.ath.cx/diff/bug39018_2.phpt
>
>
>
> Thanks.
>
> --
> Regards,
>
> Felipe Pena.
>
>