Re: Proposal to deprecate create_function()

From: Date: Tue, 15 Oct 2013 16:11:55 +0000
Subject: Re: Proposal to deprecate create_function()
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-69568@lists.php.net to get a copy of this message
On Mon, 2013-10-14 at 22:33 +0100, Rowan Collins wrote: > I would like to propose that create_function() be officially deprecated, > to encourage people to use the much safer and more powerful anonymous > functions we've had since 5.3, and eventually allow this relic to be > removed from the language. In general: Getting rid of it is good. But mind that closures are no full replacement as with create_function() the code can be created on the fly. Emulating it with eval() is also complicated as it has this nice trick of creating function names which start with \0 and therefore don't appear in function lists. I don't think this is a commonly used feature, but when kicking create_function() we should not call closures+eval a full replacement. johannes

« previous php.internals (#69568) next »