Re: RFC: Add a deprecated modifier for functions

From: Date: Wed, 26 Dec 2012 22:08:17 +0000
Subject: Re: RFC: Add a deprecated modifier for functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Wed, Dec 26, 2012 at 10:04 PM, Eugene L Kovalenja <[email protected]>wrote:

> Hello, Khalil
>
> Could you explain the pros of your proposal in comparison with the next
> one:
>
>    <?php
>
>    function somethingWillBeRemovedInNextVe**rsion() {
>          trigger_error('This function is deprecated. '
>              . 'Please use "newFunction" instead. ',
>          E_USER_DEPRECATED);
>
>
>          // functionality below
>
>          return 'something';
>    }
>
>    function newFunction() {
>         // ...
>    }
>
>    somethingWillBeRemovedInNextVe**rsion();
>
>
> From my point of view, the modifier for this kind of things is the
> restriction for developers, who want to inform user about details like "why
> we are going to remove this functionality".
>

I agree with Eugene. It's much better to throw a E_USER_DEPRECATED error
with a meaningful custom error message. So -1 on this.

Nikita


Thread (11 messages)

« previous php.internals (#64440) next »