Re: Proposal to deprecate create_function()

From: Date: Fri, 18 Oct 2013 12:41:54 +0000
Subject: Re: Proposal to deprecate create_function()
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 18/10/2013 06:25, Pierre Joye wrote:
Well, to an extent - it is not true that any PHP script which works in PHP
5.2 will work in PHP 5.5, let alone work identically. For instance, call-time pass-by-reference causes a fatal error in PHP >= 5.4; unlike calls to create_function, it's tricky to search for code that used that, and to be confident of the implications of changing it. Comparing a widely used feature, working well with something that never really worked (and why we have removed it) is hardly a good argument to remove create_function :-)
Absolutely, every proposal has to be evaluated on its merits, and that was just an example of a different situation where different conclusions were reached. But "it works" seems a little too superficial to me, and I wanted to tease out the details of this particular case. To continue with the call-time pass-by-reference example, it was perfectly possible to write code which relied on that feature; it just wasn't a terribly good idea. In fact, I came upon this manual page the other day: http://php.net/debug_zval_dump The examples rely on the fact that the caller can decide whether something is passed by value or reference. In PHP >=5.4, that function is slightly more useless than it was before. -- Rowan Collins [IMSoP]

Thread (33 messages)

« previous php.internals (#69676) next »