You mean, tons of PHP scripts? It would just allow some non-working code (fatal error) to run, by extending the scope of self::. So what could it break? And if you add the obligation to implement an interface (probably under-used in PHP), it is even less likely that it raises side effects. No ?
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Etienne Kneuss Sent: jeudi 27 septembre 2007 01:11 To: Baptiste Autin Cc: Stanislav Malyshev; Zoe Slattery; Dmitry Stogov; Marcus Boerger; Lukas Kahwe Smith; Michael Lively; internals@lists.php.net; Andi Gutmans Subject: Re: [PHP-DEV] [patch] Late static bindings (LSB) Hello, if I understand you correctly, you want to radically change the behavior of self:: ? This is not doable as it would break tons of scripts! Regards On 9/27/07, Baptiste Autin <[EMAIL PROTECTED]> wrote: > > >People generally prefer compile-time > >control which is derived from definition rather than per-instance > >runtime control (implementing interface vs. checking each time if class > >has certain methods). > > It's me again, sorry. > So, if I understand you well, Stanislas, you are personally not much into > "static::" but more into making that sort of code working : > > interface iC { > public $structure; > } > abstract class A implements iC { > public function display() { > echo self::$structure; > } > } > class B extends A { > static public $structure = "This is a string."; > } > $b = new B(); > $b->display(); > > > If so, what's the problem? > Is there a technical difficulty of implementation behind? > Or is it because we are unsure whether all the people asking for "LSB" > would > be satisfied with that way? > > BTW, here's a funny sort of polymorphism with static members that already > runs great with the actual PHP release: > > interface iC { > function getStructure(); > } > abstract class A implements iC { > public function display() { > echo $this->getStructure(); > } > } > abstract class B extends A { > static public $structure = "This is a string from B."; > } > class C extends B { > static public $structure = "This is a string from C."; > public function getStructure() { > return self::$structure; > } > } > $c = new C(); > $c->display(); > > Remove the definition of $structure in C, and the one in B will apply. > I suppose Michael Lively's example would be solved (the one with the > TableSelectQueries), if it could work the same way in a fully static > context > (and without the help of an additional method like getStructure) > ... Right ? > > Baptiste > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php