php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70332 Wrong behavior while returning reference on object
Submitted: 2015-08-23 12:21 UTC Modified: -
From: laruence@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.0RC1 OS:
Private report: No CVE-ID: None
 [2015-08-23 12:21 UTC] laruence@php.net
Description:
------------
none

Test script:
---------------
<?php
function & test($arg) {
    return $arg;
}

$arg = new Stdclass();
$arg->name = array();

test($arg)->name[1] = "xxxx";

var_dump($arg);

Expected result:
----------------
object(stdClass)#1 (1) {
  ["name"]=>
  array(1) {
    [1]=>
    string(4) "xxxx"
  }
}

Actual result:
--------------
object(stdClass)#1 (1) {
  ["name"]=>
  array(0) {
  }
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-23 12:48 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f56534e4b93f4c348298c223c95fcca38d95777e
Log: Fixed Bug #70332 (Wrong behavior while returning reference on object)
 [2015-08-23 12:48 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-09-03 18:10 UTC] ab@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f56534e4b93f4c348298c223c95fcca38d95777e
Log: Fixed Bug #70332 (Wrong behavior while returning reference on object)
 [2016-07-20 11:36 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f56534e4b93f4c348298c223c95fcca38d95777e
Log: Fixed Bug #70332 (Wrong behavior while returning reference on object)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC