rfc:functionarraydereferencing
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:functionarraydereferencing [2009/05/02 05:48] – moving status to declined philip | rfc:functionarraydereferencing [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Function Array Dereferencing (FAD) ====== | ====== Function Array Dereferencing (FAD) ====== | ||
- | * Version: | + | * Version: |
* Date: June 16, 2008 (added) | * Date: June 16, 2008 (added) | ||
* Date: May 01, 2009 (declined) | * Date: May 01, 2009 (declined) | ||
- | * Author: Philip Olson <philip@roshambo.org> | + | |
- | * Status: | + | |
+ | * Status: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Note: This RFC was given the " | + | This RFC proposes |
- | + | ||
- | This RFC is incomplete and exists as a historical record for the discussion | + | |
===== Proposal and Patch ===== | ===== Proposal and Patch ===== | ||
- | No proposal, or patch, as this is simply information gathering for archival purposes. | + | Patch: http:// |
===== Examples ===== | ===== Examples ===== | ||
Line 21: | Line 19: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | |||
- | echo fruit()[' | ||
function fruit () { | function fruit () { | ||
return array(' | return array(' | ||
} | } | ||
+ | |||
+ | echo fruit()[' | ||
+ | |||
?> | ?> | ||
</ | </ | ||
Line 34: | Line 33: | ||
<code php> | <code php> | ||
<?php | <?php | ||
+ | |||
+ | function fruit () { | ||
+ | return array(' | ||
+ | } | ||
$fruits = fruit(); | $fruits = fruit(); | ||
echo $fruits[' | echo $fruits[' | ||
- | function | + | ?> |
- | return | + | </ |
+ | |||
+ | Working with references: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | function | ||
+ | return | ||
} | } | ||
+ | |||
+ | $a = array(1); | ||
+ | $b = foo($a)[0]; | ||
+ | $b = 2; | ||
+ | var_dump($b); | ||
+ | |||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | Chaining: | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | class foo { | ||
+ | public $array = array(); | ||
+ | |||
+ | public function __construct() { | ||
+ | $this-> | ||
+ | } | ||
+ | |||
+ | public function bar() { | ||
+ | return $this-> | ||
+ | } | ||
+ | } | ||
+ | |||
+ | $foo = new foo; | ||
+ | var_dump($foo-> | ||
+ | $foo-> | ||
+ | var_dump($foo-> | ||
+ | |||
?> | ?> | ||
</ | </ | ||
Line 49: | Line 90: | ||
* April 3, 2004: http:// | * April 3, 2004: http:// | ||
* November 9, 2006: http:// | * November 9, 2006: http:// | ||
- | + | * June 3, 2010: http:// | |
- | ===== Where to go next ===== | + | * June 7, 2010: http:// |
- | + | ||
- | Tasks: | + | |
- | * Find and list additional discussions about this topic | + | |
- | * Research its implementation and impact | + | |
- | * Write a proper RFC | + |
rfc/functionarraydereferencing.1241243315.txt.gz · Last modified: 2017/09/22 13:28 (external edit)