Dmitry Stogov wrote:
Hi Mike,

I finally found a day to look into your patch and make it work in all (may
be I forgot something) cases.

Improved patch and test cases are attached.

I still don't like name - "static",

as long as it gets in, I'll love you [all] whatever name you give it! :-)

and I am not sure that this concept is necessary for PHP.

every halfassed phper doing OO in php5 would then love to know
how Zend intends implement something like:

Person::findAll( $myFilter )

... with out having to actually implement a findAll method in
the Person class (i.e. using a single generic findAll method defined
in whatever DataObject class Person is derived from (ZDataObject IIRC).

seriously; if there is a clean way of doing it without the introduction
of a static late binding keyword/token (forgive me if mine use of terminology 
is off)
then please put us out of our misery (or point me to the place I can learn and 
I'll
put myself out of my misery ;-) - I've been struggling to find a decent
solution to this since php5 was in beta and I regularly search around to see
how other are coping with this issue  - in almost all cases it turns out to be
something like:

$peeps = Person::findAll('Person', $myFilter)

or

$p = new Person; $peeps = $p->findAll( $myFilter );

niether of which really do it for me, and in the second example it feels
like some OO principles are being thoroughly raped.

rgds,
Jochem


Thanks. Dmitry.

-----Original Message-----
From: Mike Lively [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 12:06 AM
To: Dmitry Stogov
Cc: Andi Gutmans; PHP-DEV; Marcus Boerger
Subject: [PHP-DEV] [PATCH] Late Static Binding (Take 2)


On Wed, 2006-03-01 at 17:37 +0300, Dmitry Stogov wrote:

1) I would very like to see some real example where "static" is necessary?

2) "static" is really bad name. I suggest "caller", Marcus thought about "class".

3) I COMPLETELY DISAGREE TO ADD RUNTIME DATA INTO zend_function/zend_op_array. We can try to store "caller_scope" in execute_data.

Thanks. Dmitry.


Rewrote the patch to use execute_data to store caller_scope. I have not renamed any functions or keywords (still using static::) as I did not see any consensus on that yet.

Please review the implementation of caller_scope and I can take care of the naming issues when names are decided on.

patch attached and also available at http://test.ft11.net/_mlively/late-static-binding.patch

It would be nice if the patch in PAT could be changed to reference this new version if the appropriate people have time.




--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to