3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myIsset($value) { return isset($value); } $array1 = array( 'str' => 'foo', 'null1' => null, 'null2' => null, 'bool' => true, ); $filtered_array1 = array_filter($array1, 'myIsset'); var_dump($array1, $filtered_array1, array_diff($array1, $filtered_array1)); $array2 = $array1; $array2['bool'] = false; $filtered_array2 = array_filter($array2, 'myIsset'); var_dump($array2, $filtered_array2, array_diff($array2, $filtered_array2));
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { ["str"]=> string(3) "foo" ["null1"]=> NULL ["null2"]=> NULL ["bool"]=> bool(true) } array(2) { ["str"]=> string(3) "foo" ["bool"]=> bool(true) } array(2) { ["null1"]=> NULL ["null2"]=> NULL } array(4) { ["str"]=> string(3) "foo" ["null1"]=> NULL ["null2"]=> NULL ["bool"]=> bool(false) } array(2) { ["str"]=> string(3) "foo" ["bool"]=> bool(false) } array(0) { }

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:
42.11 ms | 402 KiB | 8 Q