php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52332 Static Member Reference Not Updating
Submitted: 2010-07-14 03:13 UTC Modified: 2010-07-14 11:47 UTC
From: kolb0057 at umn dot edu Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.2.13 OS: Windows XP Home SP3
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: kolb0057 at umn dot edu
New email:
PHP Version: OS:

 

 [2010-07-14 03:13 UTC] kolb0057 at umn dot edu
Description:
------------
When an object's member is assigned as a reference to a different class' static member and that static member is itself later assigned by reference, the original object member's reference is not being updated.


I posted this question to the PHP General Mailing List.  One user confirmed the bug for V5.0.0 to V5.3.3RC2.  In case you would like to search the archive, the subject of the email was "Static Class Member References".

Test script:
---------------
<?php
class A
{
  public static $a = 3;
}

class B 
{
	public $b;

	public function assign()
	{
		$this->b =& A::$a;
	}
}

$b = new B;
$a = new A;
$b->assign();
A::$a =& $a;

var_dump($b->b); // expected: object(A) | result: int 3
?>

Expected result:
----------------
I expect 'var_dump($b->b);'  to print: object(A).

Actual result:
--------------
'var_dump($b->b);' is actually printing 'int 3'.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-14 03:14 UTC] kolb0057 at umn dot edu
Thank you.
 [2010-07-14 11:47 UTC] mgf@php.net
-Status: Open +Status: Bogus
 [2010-07-14 11:47 UTC] mgf@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

For exactly *why* this is not a bug, please see http://marc.info/?m=127909866518318
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 08:01:30 2024 UTC