|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-01-18 11:20 UTC] dominik dot bulaj at gmail dot com
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 ...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 21:00:02 2025 UTC |
I am getting a similar issue with PHP 5.2.1, Linux, with eAccelerator. I have two classes like: class Foo { protected $item; function __construct() { $this->item = 'Foo'; } } class Bar extends Foo {} When I do: $c = new Bar(); I get the same fatal error as described in the original report. When I disable eaccelerator, this goes away. I will submit a bug to eaccelerator.