[nycphp-talk] Intellectual Monday
billy.reisinger at gmail.com
Mon Jan 22 20:45:32 EST 2007
I got nothing on chaining, but I have some opinions about the
The prototyping concept in general is similar to using a static
is common to all instances of that function (read: class). If one
instance decides to change that prototype, all instances of that
function immediately inherit that change. Additionally, the
prototype resides in a single spot in physical memory (supposedly),
such that every new copy of a function uses the same set of
prototypes. I'm not a PHP expert, but I imagine there is a similar
concept in PHP....
environment is that it actually allows you to extend native objects,
which themselves are just functions. Extending native objects (i.e.
Function, Object, Array, Element, etc.) can lead to unexpected errors
when your code interacts with an outside environment. Just to give
you an example, extending the Array class with custom methods leads
to these methods appearing as entries for every array in foreach
loops. Probably not what you wanted.
does. Probably a good thing, anyway.
On Jan 22, 2007, at 12:49 PM, Cliff Hirsch wrote:
> several concepts.
> 1. jQuery uses chaining, whereby every method within jQuery returns
> the query object itself.
> adding methods to existing classes.
> I wonder how these techniques work in the PHP world. Does anyone
> use chaining effectively? Is there a PHP equivalent to the
> prototype concept?
> New York PHP Community Talk Mailing List
> NYPHPCon 2006 Presentations Online
> Show Your Participation in New York PHP
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the talk