RE: [PHP-DEV] Coercive STH - some real world tests and updated RFC
| From: | François Laupretre | Date: | Sat, 28 Feb 2015 08:00:33 +0000 |
| Subject: | RE: [PHP-DEV] Coercive STH - some real world tests and updated RFC | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84071@lists.php.net to get a copy of this message | ||
> De : Benjamin Eberlei [mailto:kontakt@beberlei.de]
>
> The funny thing is that the fix for this is:
>
> - substr($image, strrpos($image, "\n") + 1)
> + (string)substr($image, strrpos($image, "\n") + 1)
>
> Which is that sort of casting that is put forward as argument against the
> dual/strict mode.
It is just one possible fix, but definitely not the one I would suggest, because too permissive. No
controversy please, because both are valid. I would just prefer adding a test like 'if
($result===false) $result='';'.
Regards
François