Table of Contents

Function Array Dereferencing (FAD)

Introduction

Note: This RFC was given the “declined” status because it was never implemented or strongly desired. However, no official discussion exists to “decline” except CVS does not lie, and it's not in CVS.

This RFC is incomplete and exists as a historical record for the discussion of this feature request.

Proposal and Patch

No proposal, or patch, as this is simply information gathering for archival purposes.

Examples

FAD adds the following:

<?php
 
echo fruit()['a']; // apple
 
function fruit () {
  return array('a' => 'apple', 'b' => 'banana');
}
?>

Which is a quasi-replacement for this:

<?php
 
$fruits = fruit();
echo $fruits['a'];
 
function fruit () {
  return array('a' => 'apple', 'b' => 'banana');
}
?>

Related discussion

The following discussions/threads have taken place:

Where to go next

Tasks: