From:             dominik dot bulaj at gmail dot com
Operating system: Debian
PHP version:      5.2.0
PHP Bug Type:     Class/Object related
Bug description:  Cannot access protected property

Description:
------------
I got 3 classes:

abstract class BlogApi
{
    protected $blogUrl  = false;
    // other properties

    public function setup($blogUrl, $username, $password, $blogId = 1)
    {
        $this->blogUrl  = $blogUrl;
        $this->username = $username;
        $this->password = $password;
        $this->blogId   = $blogId;
        
        return $this;
    }
    // rest of methods
}

abstract class BloggerApi extends BlogApi
{
    // some methods specyfic for BloggerApi
    
}

class WordPress extends BloggerApi
{
    // some methods
    public function publish()
    {
        return $this->publishToBlog(rtrim($this->blogUrl,
'/').'/xmlrpc.php');
    }
}


Now when I start with:

$wp = new WordPress;
$wp->setup('some_url', 'usr_name', 'pwd', 1);
// another method to set-up post subject & body
$wp->publish();

I got error:

Fatal error: Cannot access protected property WordPress::$blogUrl in ....

Strange is, that code worked well in PHP 5.1.6-5 on Debian.

Actual result:
--------------
Fatal error: Cannot access protected property WordPress::$blogUrl in ...

-- 
Edit bug report at http://bugs.php.net/?id=40159&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40159&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40159&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40159&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40159&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40159&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40159&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40159&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40159&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40159&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40159&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40159&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40159&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40159&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40159&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40159&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40159&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40159&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40159&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40159&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40159&r=mysqlcfg

Reply via email to