Ask a Question related to PHP Bugs, Design and Development.
-
dominik dot bulaj at gmail dot com #1
#40159 [NEW]: Cannot access protected property
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 [url]http://bugs.php.net/?id=40159&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40159&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40159&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40159&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40159&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40159&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40159&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40159&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40159&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40159&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40159&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40159&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40159&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40159&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40159&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40159&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40159&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40159&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40159&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40159&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40159&r=mysqlcfg[/url]
dominik dot bulaj at gmail dot com Guest
-
#40159 [Opn->Fbk]: Cannot access protected property
ID: 40159 Updated by: tony2001@php.net Reported By: dominik dot bulaj at gmail dot com -Status: Open +Status: ... -
#29234 [Com]: empty($object->property) incorrect when property has access overloaded (__get)
ID: 29234 Comment by: phpbugs at thunder-2000 dot com Reported By: chrissy at codegoat dot com Status: No... -
Access password protected data
Hi, I would like to access XML data from a third party server. Unfortunately the URL is password protected (simple web server, directory based... -
How to make a protected property in the base component public in the derived component?
I have a base component, from which several components derive. What I want is to just publish some of the protected properties in the base... -
Unable to access the Web Service in a RSA secured/protected environment
Hi all, I am working on MS .NET Alerts to be implemented at our site. We have our web applications in ASP 3.0 I have created a local web service... -
bugs dot php at mobocracy dot net #2
#40159 [Com]: Cannot access protected property
ID: 40159
Comment by: bugs dot php at mobocracy dot net
Reported By: dominik dot bulaj at gmail dot com
Status: No Feedback
Bug Type: Class/Object related
Operating System: Debian
PHP Version: 5.2.0
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2007-01-26 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2007-01-18 11:22:32] [email]tony2001@php.net[/email]
Cannot reproduce.
------------------------------------------------------------------------
[2007-01-18 11:20:19] 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
....
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40159&edit=1[/url]
bugs dot php at mobocracy dot net Guest
-
bugs dot php at mobocracy dot net #3
#40159 [Com]: Cannot access protected property
ID: 40159
Comment by: bugs dot php at mobocracy dot net
Reported By: dominik dot bulaj at gmail dot com
Status: No Feedback
Bug Type: Class/Object related
Operating System: Debian
PHP Version: 5.2.0
New Comment:
BTW, this appears to be fixed with eaccelerator svn snapshot 301.
-Blake
Previous Comments:
------------------------------------------------------------------------
[2007-02-22 06:16:58] bugs dot php at mobocracy dot net
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.
------------------------------------------------------------------------
[2007-01-26 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2007-01-18 11:22:32] [email]tony2001@php.net[/email]
Cannot reproduce.
------------------------------------------------------------------------
[2007-01-18 11:20:19] 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
....
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40159&edit=1[/url]
bugs dot php at mobocracy dot net Guest
-
tony2001@php.net #4
#40159 [NoF->Bgs]: Cannot access protected property
ID: 40159
Updated by: [email]tony2001@php.net[/email]
Reported By: dominik dot bulaj at gmail dot com
-Status: No Feedback
+Status: Bogus
Bug Type: Class/Object related
Operating System: Debian
PHP Version: 5.2.0
New Comment:
Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader. These extensions often modify engine
behavior which is not related to PHP itself.
Previous Comments:
------------------------------------------------------------------------
[2007-02-22 06:21:48] bugs dot php at mobocracy dot net
BTW, this appears to be fixed with eaccelerator svn snapshot 301.
-Blake
------------------------------------------------------------------------
[2007-02-22 06:16:58] bugs dot php at mobocracy dot net
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.
------------------------------------------------------------------------
[2007-01-26 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2007-01-18 11:22:32] [email]tony2001@php.net[/email]
Cannot reproduce.
------------------------------------------------------------------------
[2007-01-18 11:20:19] 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
....
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40159&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

