3v4l.org

run code in 300+ PHP versions simultaneously
<?php function yourStuff($month) { return (ctype_digit($month) && (intval($month) > 0 && intval($month) < 13)); } function simple($monthNumber) { $value = (int)$monthNumber; return $value >= 1 && $value <= 12; } echo yourStuff(1); // 0 echo PHP_EOL; echo yourStuff("1"); // 1 echo PHP_EOL; echo yourStuff(2); // 0 echo PHP_EOL; echo yourStuff("3"); // 1 echo PHP_EOL; echo yourStuff("potato"); // 0 echo PHP_EOL; echo PHP_EOL; echo '----'; echo PHP_EOL; echo PHP_EOL; // echo simple(1); // 1 // echo PHP_EOL; // echo simple("1"); // 1 // echo PHP_EOL; // echo simple(2); // 1 // echo PHP_EOL; // echo simple("3"); // 1 // echo PHP_EOL; // echo simple("potato"); // 0
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: ctype_digit(): Argument of type int will be interpreted as string in the future in /in/43N1A on line 5 1 Deprecated: ctype_digit(): Argument of type int will be interpreted as string in the future in /in/43N1A on line 5 1 ----

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:
63.95 ms | 401 KiB | 8 Q