php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70921 Under certain conditions, SplObjectStorage missing attribute
Submitted: 2015-11-16 07:40 UTC Modified: 2017-10-09 18:05 UTC
From: b dot zhao1 at gmail dot com Assigned:
Status: Not a bug Package: SPL related
PHP Version: 5.5.30 OS: OS X 10.9.3
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: b dot zhao1 at gmail dot com
New email:
PHP Version: OS:

 

 [2015-11-16 07:40 UTC] b dot zhao1 at gmail dot com
Description:
------------
//attribute::values equals attribute->getValues()
print_r($attribute);
print_r($attribute->getValues());

//valuesBlue::attribute not equals valuesBlue->getValues() (missing "blue" Value Object attribute `name` and `attribute`)
print_r($valueBlue);
print_r($valueBlue->getAttribute());

Test script:
---------------
https://bitbucket.org/billzhao/php-algorithm/raw/e445f6d26659823abfc58da21a89ff9ad3b672aa/1.php


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-24 04:34 UTC] b dot zhao1 at gmail dot com
Test Script Change To:
https://bitbucket.org/billzhao/php-algorithm/raw/a651d62ec295f4b46403d91ca325ff763bf00d3c/php/1.php
 [2017-10-09 18:05 UTC] nikic@php.net
-Status: Open +Status: Not a bug
 [2017-10-09 18:05 UTC] nikic@php.net
The output looks correct to me -- what's probably tripping your up is the recursion detection in print_r. If you dump the blue Value then the blue Value inside Attribute is recursive and will print *RECURSION* rather than the value. It's still there though, just not printed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 13:00:02 2026 UTC