Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic

From: Date: Sun, 24 Oct 2010 23:04:00 +0000
Subject: Re: BC break in 5.3.2 -> 5.3.3 with "parent::" and __call/__callStatic
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-49966@lists.php.net to get a copy of this message
On Oct 25 0:56:28, Etienne Kneuss wrote: > On Oct 24 15:41:44, Stas Malyshev wrote: > > Hi! > > > > >class Bar { > > > // override getFoo() to add some specific behaviour > > > public function getFoo() { > > > // do the specific stuff > > > parent::getFoo(); > > > } > > >} > > > > I think you meant Bar to extend ActiveRecord? But anyway, I think > > that this particular call should be done through __call, not > > __callStatic, since it's basically non-static call. The line between > > the two wasn't really well-defined in PHP (you could call static > > methods non-statically and vice versa) which is a pity but I think > > distinction can be made in this case. > > Exactly, if Bar::getFoo is not called statically, parent::getFoo() will > not be a static call, it should not get through __callStatic. > > Best, Oh, and #51176 seems bogus to me. "::" is not sufficient to indicate a static call, neither is "self::", "static::", or "Foo::". A call is only static if one of the two following conditions match: 1) the target method is declared as static 2) the call comes from an object-less scope > > > > > -- > > Stanislav Malyshev, Software Architect > > SugarCRM: http://www.sugarcrm.com/ > > (408)454-6900 ext. 227 > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > Etienne Kneuss > http://www.colder.ch > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Etienne Kneuss http://www.colder.ch

« previous php.internals (#49966) next »