Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 713a3fc58c
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (25 sloc) 0.526 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
--TEST--
Returning a reference from a function.
--FILE--
<?php
function &returnRef() {
global $a;
return $a;
}

function returnVal() {
global $a;
return $a;
}

$a = "original";
$b =& returnVal();
$b = "changed";
var_dump($a); //expecting warning + "original"

$a = "original";
$b =& returnRef();
$b = "changed";
var_dump($a); //expecting "changed"
?>
--EXPECTF--

Strict Standards: Only variables should be assigned by reference in %s on line 13
string(8) "original"
string(7) "changed"
Something went wrong with that request. Please try again.