3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( 0 => array ( 'admin_id' => '4', 'full_name' => 'Jesse Donat', 'timestamp' => 'Thu, 23 Oct 2014 03:34:40 +0000', ), 1 => array ( 'admin_id' => '4', 'full_name' => 'Jesse Donat', 'timestamp' => 'Thu, 23 Oct 2014 03:34:40 +0000', ), 2 => array ( 'bbq' => 'soda', ), ); print_r($data); $data = array_reduce($data, function ($c, $i) { if (!in_array($i, $carry)) { $c[] = $i; }}, []); print_r($data);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [admin_id] => 4 [full_name] => Jesse Donat [timestamp] => Thu, 23 Oct 2014 03:34:40 +0000 ) [1] => Array ( [admin_id] => 4 [full_name] => Jesse Donat [timestamp] => Thu, 23 Oct 2014 03:34:40 +0000 ) [2] => Array ( [bbq] => soda ) ) Warning: Undefined variable $carry in /in/nd6RN on line 23 Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /in/nd6RN:23 Stack trace: #0 /in/nd6RN(23): in_array(Array, NULL) #1 [internal function]: {closure}(Array, Array) #2 /in/nd6RN(23): array_reduce(Array, Object(Closure), Array) #3 {main} thrown in /in/nd6RN on line 23
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:
35.86 ms | 402 KiB | 8 Q