3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array_0 = [ ['firstName' => 'Zoe', 'lastName' => 'Black', 'age' => 32, 'sex' => 'Female'], ['firstName' => 'Alex', 'lastName' => 'Katter', 'age' => 24, 'sex' => 'Male'], ['firstName' => 'Daniel', 'lastName' => 'Farmer', 'age' => 54, 'sex' => 'Male'], ['firstName' => 'Casy', 'lastName' => 'Denali', 'age' => 26, 'sex' => 'Female'], ['firstName' => 'Dave', 'lastName' => 'Desopolous', 'age' => 21, 'sex' => 'Male'], ['firstName' => 'Hugo', 'lastName' => 'Tesserat', 'age' => 43, 'sex' => 'Male'], ['firstName' => 'Sandy', 'lastName' => 'Williams', 'age' => 34, 'sex' => 'Female'], ['firstName' => 'Beth', 'lastName' => 'Baronksy', 'age' => 39, 'sex' => 'Female'], ['firstName' => 'David', 'lastName' => 'Faller', 'age' => 63, 'sex' => 'Male'], ['firstName' => 'Daniel', 'lastName' => 'Dekresta', 'age' => 32, 'sex' => 'Male'] ]; $orderBy_0 = function ($i) { return $i['firstName']; }; $orderBy_1 = function ($i) { return $i['lastName']; }; $t = function & () use ($array_0, $orderBy_0, $orderBy_1) { $projected_0 = []; $projected_1 = []; $elements_0 = []; $elements_0 = []; foreach($array_0 as $key_1 => &$value_1) { $keyHash_0 = \Pinq\Iterators\Common\Identity::hash($key_1); $keyMap_0[$keyHash_0] = $key_1; $projected_0[$keyHash_0] = $orderBy_0($value_1, $key_1); $projected_1[$keyHash_0] = $orderBy_1($value_1, $key_1); $elements_0[$keyHash_0] =& $value_1; unset($value_1); } foreach($elements_0 as $keyHash_0 => &$value_0) { $key_0 = $keyMap_0[$keyHash_0]; yield $key_0 => $value_0; unset($value_0); } }; var_dump(iterator_to_array($t(), true));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "Pinq\Iterators\Common\Identity" not found in /in/QiFdc:26 Stack trace: #0 [internal function]: {closure}() #1 /in/QiFdc(41): iterator_to_array(Object(Generator), true) #2 {main} thrown in /in/QiFdc on line 26
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.1 ms | 401 KiB | 8 Q