rfc:functionarraydereferencing

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:functionarraydereferencing [2010/06/08 11:00] – Change status feliperfc:functionarraydereferencing [2010/06/09 10:50] – Update felipe
Line 49: Line 49:
 <code php> <code php>
 <?php <?php
- 
 function &foo(&$foo) { function &foo(&$foo) {
  return $foo;  return $foo;
 } }
 + 
 $a = array(1); $a = array(1);
-foo($a)[0] = 2; +$b = foo($a)[0]
-var_dump($a); // array(1) {  [0]=>  int(2) }+$b = 2; 
 +var_dump($b); // array(1) {  [0]=>  int(2) }
  
 ?> ?>
rfc/functionarraydereferencing.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1