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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 01:04:05 2022 UTC