Re: Code References

From: Date: Mon, 19 May 2003 17:48:13 +0000
Subject: Re: Code References
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-1728@lists.php.net to get a copy of this message
At 10:42 AM 5/19/2003 -0400, Sterling Hughes wrote:
Well, right. As I've mentioned beforehand, speed is really a secondary factor, although it does exist, and the concept of code references (passing around function pointers as opposed to function names) would make php faster anywhere callbacks are used. But its also a cleanliness and ease-of-use factor. If you look at the amount create_function() is used in PHP code, its next to nil. With other scripting languages such features are commonly used (and very *useful* imho). One could assume this is because PHP users don't need it, but I think its more due to the way its kludged in (imho again). I think a clear way of having function pointers, and then a nice syntax for declaring anonymous subroutines (read: I don't want to stash my code inside a variable), would be something really useful.
I must agree with the opposition about the introduction of 'code references'. Personally, I don't think code which makes extensive use of code references is very readable in general so saying that create_function() is ugly is interesting :) Anyway, I think create_function() is there, it works, and I don't see a convincing reason for something slightly different. Andi

« previous php.internals (#1728) next »