Re: [PHP-DEV] Make zend_parse_parameters emit E_RECOVERABLE_ERROR

[email protected] (Xinchen Hui)
Newsgroups php.internals
Message-ID <CABBJUpedHeCArT+8YqUv906vQSbWJ_hvcjgbg-J5CNYZQhyHUg@mail.gmail.com>
On Mon, Sep 1, 2014 at 6:01 AM, Andrea Faulds <[email protected]> wrote:
> Good evening,
>
> Here’s a suggestion: Why don’t we make zend_parse_parameters emit

""Why not" is usually not a very good reason for a change in the language
syntax. " -- Stas

> E_RECOVERABLE_ERROR on failure, rather than just emitting E_WARNING and
> returning FAILURE (causing the caller to typically bail out and return NULL)?
> This would bring it into line with userland type hints, which also cause such
> errors. It might also cause errors to be caught sooner, as just returning NULL
> can cause cryptic problems down the line. It’s worth noting that
> zend_parse_parameters is very tolerant in terms of what parameters you can pass
> it and is unlikely to error unless you do something really weird such as
> passing an array to strlen().
PHP is a looser type language... such things might be happened. and
internal functions always check their arguments.

this will make the PHP app more robust.
> I doubt this would affect backwards compatibility
> much, unless your application relies on a silenced warning (which is possible,
> but discouraged behaviour), and it’s the type of BC break that would be really
> obvious (your application errors and stops execution).
that will be a nightmare to stop people upgrade their PHP.

thanks
>
> Thoughts?
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Xinchen Hui
@Laruence
http://www.laruence.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.