3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check_type($value) { var_dump($value); return $value; } $values = [ null, false, true, 42, 45.15, 'hello', ['array1', 'array2', 15, 25], new stdClass(), gmp_init('4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444'), ]; foreach ($values as $value) { $filtered_var = filter_var($value, FILTER_CALLBACK, ['options' => 'check_type']); var_dump($filtered_var); }
Output for git.master, git.master_jit
string(0) "" string(0) "" string(0) "" string(0) "" string(1) "1" string(1) "1" string(2) "42" string(2) "42" string(5) "45.15" string(5) "45.15" string(5) "hello" string(5) "hello" string(6) "array1" string(6) "array2" string(2) "15" string(2) "25" array(4) { [0]=> string(6) "array1" [1]=> string(6) "array2" [2]=> string(2) "15" [3]=> string(2) "25" } bool(false) bool(false)

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:
26.38 ms | 406 KiB | 5 Q