3v4l.org

run code in 300+ PHP versions simultaneously
<?php $users=Array ( 0 => Array ( 'id' => 111, 'name' => 'Sandra Shush', 'sources' => '1234,678,780,199' ), 1 => Array ( 'id' => 112, 'name' => 'Stefanie Mcmohn', 'sources' => '32,99,85' ), 2 => Array ( 'id' => 113, 'name' => 'Michael', 'sources' => '896,1213,1918' ), 3 => Array ( 'id' => 113, 'name' => 'Michael', 'sources' => '72' ) ); print_r(array_map('str_getcsv',array_column($users,'sources'))); $result = array_filter(array_map('str_getcsv',array_column($users,'sources')),function($k,$v){ if(in_array(99,$v)) return $k;}); print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 1234 [1] => 678 [2] => 780 [3] => 199 ) [1] => Array ( [0] => 32 [1] => 99 [2] => 85 ) [2] => Array ( [0] => 896 [1] => 1213 [2] => 1918 ) [3] => Array ( [0] => 72 ) ) Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed and exactly 2 expected in /in/h4iGj:34 Stack trace: #0 [internal function]: {closure}(Array) #1 /in/h4iGj(34): array_filter(Array, Object(Closure)) #2 {main} thrown in /in/h4iGj on line 34
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:
65.17 ms | 402 KiB | 8 Q