|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-02-11 08:55 UTC] scottmac@php.net
[2011-02-11 08:56 UTC] scottmac@php.net
-Status: Open
+Status: Bogus
[2011-02-11 08:56 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
Description: ------------ I'm not sure if this is a bug. If you look in code why protected method hello() can be accessed and property $this->var not, from that method? PHP 5.3.3 Test script: --------------- <?php abstract class abstract_class { abstract protected function hello(); } class A extends abstract_class { private $B; protected $var; function __construct () { $this->var = 'Undefined property??'; $this->B = new B(__CLASS__); } protected function hello() { echo 'accessing '.__CLASS__.'::protected method - hello()'.PHP_EOL; echo $this->var; }} class B extends abstract_class { function __construct ( $class_A ) { $class_A::hello(); } protected function hello(){} } new A; ?> Expected result: ---------------- access $this->var , look into script.