php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31584 5_0 (incl. 5.0.3) A bit severe problem with protected properties
Submitted: 2005-01-17 13:37 UTC Modified: 2005-09-02 07:48 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at hristov dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5-STABLE-2005-02-28 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at hristov dot com
New email:
PHP Version: OS:

 

 [2005-01-17 13:37 UTC] php at hristov dot com
Description:
------------
The example code works with HEAD but is broken with 5_0 latest build as well as 5.0.3 . 5.0.2 and lower not checked.

Reproduce code:
---------------
php -r 'class a{protected static $foo=2;} class b extends a{function p(){var_dump(a::$foo);}}$b=new b;$b->p();'

Expected result:
----------------
int(2)

Actual result:
--------------
Fatal error: Cannot access protected property a::$foo in Command line code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-17 13:41 UTC] php at hristov dot com
Maybe it helps that it is not reproducable with 5.1.0-dev even back from Nov 29th.
 [2005-02-28 21:01 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

..and make sure the Version field in the report matches the date of the snapshot..

 [2005-03-01 00:16 UTC] php at hristov dot com
Erm, error. Works again with latest HEAD (5.1) but does not work with latest 5_0 (CVS php5-STABLE-200502282130)

Andrey
 [2005-09-02 07:48 UTC] sniper@php.net
Works in 5.1 -> considered fixed. (not everything is MFH'd to dead branches)

And FYI: There is no such version as 'PHP5', there are only numbers in versions..

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 16:01:34 2025 UTC