rfc:functionarraydereferencing
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:functionarraydereferencing [2010/06/07 22:44] – Update felipe | rfc:functionarraydereferencing [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Date: June 07, 2010 (re-opened) | * Date: June 07, 2010 (re-opened) | ||
* Author: Philip Olson < | * Author: Philip Olson < | ||
- | * Status: | + | * Status: |
===== Introduction ===== | ===== Introduction ===== | ||
Line 20: | Line 19: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | |||
- | echo fruit()[' | ||
function fruit () { | function fruit () { | ||
return array(' | return array(' | ||
} | } | ||
+ | |||
+ | echo fruit()[' | ||
+ | |||
?> | ?> | ||
</ | </ | ||
Line 33: | Line 33: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | |||
- | $fruits = fruit(); | ||
- | echo $fruits[' | ||
function fruit () { | function fruit () { | ||
return array(' | return array(' | ||
} | } | ||
+ | |||
+ | $fruits = fruit(); | ||
+ | echo $fruits[' | ||
+ | |||
?> | ?> | ||
</ | </ | ||
Line 47: | Line 48: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | |||
function & | function & | ||
return $foo; | return $foo; | ||
} | } | ||
+ | |||
$a = array(1); | $a = array(1); | ||
- | foo($a)[0] = 2; | + | $b = foo($a)[0]; |
- | var_dump($a); // array(1) { [0]=> | + | $b = 2; |
+ | var_dump($b); // array(1) { [0]=> | ||
?> | ?> | ||
</ | </ | ||
Line 79: | Line 81: | ||
$foo-> | $foo-> | ||
var_dump($foo-> | var_dump($foo-> | ||
+ | |||
?> | ?> | ||
</ | </ | ||
Line 88: | Line 91: | ||
* November 9, 2006: http:// | * November 9, 2006: http:// | ||
* June 3, 2010: http:// | * June 3, 2010: http:// | ||
- | | + | |
rfc/functionarraydereferencing.1275950682.txt.gz · Last modified: 2017/09/22 13:28 (external edit)