Professional Web Applications Themes

#40159 [NEW]: Cannot access protected property - PHP Bugs

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'); } ...

  1. #1

    Default #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

  2. #2

    Default #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]tony2001php.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

  3. #3

    Default #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]tony2001php.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

  4. #4

    Default #40159 [NoF->Bgs]: Cannot access protected property

    ID: 40159
    Updated by: [email]tony2001php.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]tony2001php.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

Similar Threads

  1. #40159 [Opn->Fbk]: Cannot access protected property
    By tony2001@php.net in forum PHP Bugs
    Replies: 0
    Last Post: January 18th, 11:22 AM
  2. Replies: 0
    Last Post: November 13th, 11:04 AM
  3. Access password protected data
    By mmJez in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: September 14th, 02:20 AM
  4. Replies: 0
    Last Post: December 16th, 12:29 AM
  5. Unable to access the Web Service in a RSA secured/protected environment
    By Vaibhav Modak in forum ASP.NET Web Services
    Replies: 0
    Last Post: January 14th, 01:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139