php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69863 __get method is not calling
Submitted: 2015-06-17 15:58 UTC Modified: 2018-08-19 17:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tugrultopuz at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: SPL related
PHP Version: 5.4.42 OS:
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: tugrultopuz at gmail dot com
New email:
PHP Version: OS:

 

 [2015-06-17 15:58 UTC] tugrultopuz at gmail dot com
Description:
------------
https://github.com/php/php-src/blob/PHP-5.4.42/ext/spl/spl_array.c#L332
https://github.com/php/php-src/blob/PHP-5.4.42/ext/spl/spl_array.c#L360

Above links are pointed to bug. Looks like there is no fallback handler for BP_VAR_RW state and not triggering __get magic method. 

Test script:
---------------
https://gist.github.com/tugrul/14a621181a2e96ac9d81

Expected result:
----------------
PHP Notice:  Undefined index: foo in /srv/www/phptest/arrayobject.php on line 26
PHP Stack trace:
PHP   1. {main}() /srv/www/phptest/arrayobject.php:0
PHP Warning:  Creating default object from empty value in /srv/www/phptest/arrayobject.php on line 26
PHP Stack trace:
PHP   1. {main}() /srv/www/phptest/arrayobject.php:0


Actual result:
--------------
class OtherArrayObject#2 (1) {
  private $storage =>
  array(1) {
    'foo' =>
    class OtherArrayObject#3 (1) {
      private $storage =>
      array(1) {
        ...
      }
    }
  }
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-08-19 17:00 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2018-08-19 17:00 UTC] cmb@php.net
Basically, this is a duplicate of bug #74058.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 01:01:28 2025 UTC