php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25432 Weird behavior with objects and references
Submitted: 2003-09-08 08:25 UTC Modified: 2003-09-08 09:55 UTC
From: alex at primafila dot net Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.3.3 OS: RedHat, MacOS X
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: alex at primafila dot net
New email:
PHP Version: OS:

 

 [2003-09-08 08:25 UTC] alex at primafila dot net
Description:
------------
Weird behavior with objects and references.

Reproduce code:
---------------
http://alex.primafila.net/bug-sample.phps

Expected result:
----------------
array(1) {
  ["type"]=>
  string(6) "strong"
}
array(1) {
  ["type"]=>
  string(6) "strong"
}

Actual result:
--------------
array(1) {
  ["type"]=>
  &string(6) "strong"
}
array(1) {
  ["type"]=>
  &string(4) "type"
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-08 08:45 UTC] sniper@php.net
That's what you get when you play around with references without understanding how they work in PHP.
In PHP 5 your script works as you expect. Won't be fixed in PHP 4.

 [2003-09-08 09:55 UTC] alex at primafila dot net
Well, actually I'm playing with references without 
knowing how buggy they are (they are not 'working' as 
you say). There is no documentation that make me 
understand 'how they work in PHP'.

No flame, enjoy your day.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 06:01:34 2025 UTC