php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70873 Regression on private static properties access
Submitted: 2015-11-06 20:19 UTC Modified: 2015-11-06 20:20 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: marcio@php.net Assigned: bwoebi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.0RC6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 + 20 = ?
Subscribe to this entry?

 
 [2015-11-06 20:19 UTC] marcio@php.net
Description:
------------
It seems that since PHP7 alpha it's possible to access private static properties of upper classes. This is an unwanted regression https://3v4l.org/4XheY

Currently on master, the same example has a failing assertion and a segfault:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
php: php/Zend/zend_object_handlers.c:279: zend_verify_property_access: Assertion `property_info->flags & 0x200' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff5ea5877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);

Expected result:
----------------
Same error as php 5.6: Fatal error: Cannot access property B::$x in /in/4XheY on line 9

Actual result:
--------------
On RC6 it's possible to access the private static property from the upper class.
On master it causes a segfault.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-06 20:20 UTC] marcio@php.net
-Assigned To: +Assigned To: bwoebi
 [2015-11-07 14:51 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d8d97cee25b632b21d4740c0c7c077196603e9d
Log: Fixed bug #70873 (Regression on private static properties access)
 [2015-11-07 14:51 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2015-11-09 18:12 UTC] ab@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=10cd3b69f835d03af340f1b8d78e878820033d17
Log: Fixed bug #70873 (Regression on private static properties access)
 [2016-07-20 11:35 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2d8d97cee25b632b21d4740c0c7c077196603e9d
Log: Fixed bug #70873 (Regression on private static properties access)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC