Re: RE:Class::? - accessing data, no success...

From: Date: Tue, 04 Jul 2000 11:15:37 +0000
Subject: Re: RE:Class::? - accessing data, no success...
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-23440@lists.php.net to get a copy of this message
w>> (B) If :: is called from outside, you can access a class╢s methods w>> directly, but you can╢t access it╢s data members, because they have not There's no "it's data members". There's only object initializers. w>> (2) I╢d prefer that accessing methods other than the overriden ones via w>> :: should *not* be possible, instead to do this there should something w>> newly be introduced to make static calls to methods of non instanciated w>> classes (and by doing this static calls to data members should be made w>> possible too). What for? No, I saw examples. I can make you 1001 examples of whatever feature could be useful. But why do you *need* it? Why can't you live without it? w>> <?php w>> class a { w>> var $test='foo'; w>> function a () { print $this->test; } } w>> w>> class b extends a { w>> function a () { w>> a::a(); }} w>> print "1)"; w>> new b; w>> print "2)"; w>> a::a(); This won't work - $this is empty in a::a. Don't do it. w>> ?> w>> *If* we allow static calls then, we should *not* use ::, then we╢d w>> introduce further ambguities, then the above example would be expected If you intend to use it like above, don't. w>> I╢d say we should introduce a new operator for static calls *if* What for? Current opearator work OK, unless you are trying to use it for something that shouldn't be done, like tring to use $this where there's no $this. -- Stanislav Malyshev stas@zend.com +972-3-6139665

« previous php.dev (#23440) next »