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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC