3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayFilters { private $array = array(); public function __construct($array){ $this->array = $array; } public function name_is($name){ return $name == $this->array['name']; } } $array1 = array( "a"=>array( 'name' => 'vasya' ,'second_name' => 'Vasilev' ), "b"=>array( 'name' => 'vasya2' ,'second_name' => 'Vasilev2' ), "c"=>array( 'name' => 'vasya3' ,'second_name' => 'Vasilev3' ), "d"=>array( 'name' => 'vasya4' ,'second_name' => 'Vasilev4' ), "e"=>array( 'name' => 'vasya5' ,'second_name' => 'Vasilev5' ) ); print_r(array_filter($array1, array(new ArrayFilter($array1), 'name_is')));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "ArrayFilter" not found in /in/mHnIH:38 Stack trace: #0 {main} thrown in /in/mHnIH on line 38
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:
37.37 ms | 401 KiB | 8 Q