Bug #53992 [NEW]: ambiguous property/method access
| From: | msg2maciej at aol dot com | Date: | Fri, 11 Feb 2011 06:23:03 +0000 |
| Subject: | Bug #53992 [NEW]: ambiguous property/method access | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-158696@lists.php.net to get a copy of this message | ||
From:
Operating system: MAC OSX
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:ambiguous property/method access
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.
--
Edit bug report at http://bugs.php.net/bug.php?id=53992&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53992&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53992&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53992&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53992&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53992&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53992&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53992&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53992&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53992&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53992&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53992&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53992&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53992&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53992&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53992&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53992&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53992&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53992&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53992&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53992&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53992&r=mysqlcfg