Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Johannes Schlüter
Yussuf Khalil wrote: >Could you please explain why a simple keyword like T_DEPRECATED could >break something? It breaks everything using "deprecated" as function name, constant, property name, class name, method name, ... as the parser doesn't know much about the meaning and context. johan

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Eugene L Kovalenja
Khalil, Short-form "deprecated" mark for internal php use - is not good practice, from my point of view (sorry if any :) ), but it is compensated by good documentation and measured pace of releases. For example, when one of PHP contributors mark the function as deprecated, it is the result w

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Yussuf Khalil
Could you please explain why a simple keyword like T_DEPRECATED could break something? Yussuf Khalil Yussuf Khalil wrote: I have created an RFC about adding a deprecated modifier for functions in PHP, see https://wiki.php.net/rfc/deprecated-modifier. What are your thoughts on this? I don

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Yussuf Khalil
Throwing an E_USER_DEPRECATED error sure is an alternative. However, I think that using a deprecated keyword instead is cleaner and faster. A native function (set_magic_quotes_runtime() for example) just needs the ZEND_ACC_DEPRECATED flag which can be added using a simple macro while a userspac

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Yahav Gindi Bar
On Wed, Dec 26, 2012 at 5:48 PM, Yussuf Khalil wrote: > Hello, > > assuming that you are referring to the RFC about annotations ( > https://wiki.php.net/rfc/**annotations) > I don't think that annotations are needed in PHP. Declarations that > actually have a

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Nikita Popov
On Wed, Dec 26, 2012 at 10:04 PM, Eugene L Kovalenja wrote: > Hello, Khalil > > Could you explain the pros of your proposal in comparison with the next > one: > > >function somethingWillBeRemovedInNextVe**rsion() { > trigger_error('This function is deprecated. ' > . '

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Johannes Schlüter
Yussuf Khalil wrote: >I have created an RFC about adding a deprecated modifier for functions >in PHP, see https://wiki.php.net/rfc/deprecated-modifier. What are your > >thoughts on this? I don't think we should add a new keyword for such a thing. Adding keywords breaks many things and causes

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Eugene L Kovalenja
Hello, Khalil Could you explain the pros of your proposal in comparison with the next one: 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". On 12/26/20

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Yussuf Khalil
Hello, assuming that you are referring to the RFC about annotations (https://wiki.php.net/rfc/annotations) I don't think that annotations are needed in PHP. Declarations that actually have an impact on the language itself (like deprecated) should rather be implemented as function modifiers wh

Re: [PHP-DEV] RFC: Add a deprecated modifier for functions

2012-12-26 Thread Yahav Gindi Bar
On Wed, Dec 26, 2012 at 4:22 PM, Yussuf Khalil wrote: > Hello, > > I have created an RFC about adding a deprecated modifier for functions in > PHP, see > https://wiki.php.net/rfc/**deprecated-modifier. > What are your thoughts on this? > > Thank you,