3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($data) { var_dump($data); var_dump(filter_var($data, FILTER_VALIDATE_INT)); echo PHP_EOL; } f(null); f(false); f(0); f("0"); f(1); f("1"); f(array()); f(array(0)); f(array(1)); class ToStringAble { function __toString() { return "0"; } } f(new ToStringAble()); f(new stdclass());
Output for git.master, git.master_jit, rfc.property-hooks
NULL bool(false) bool(false) bool(false) int(0) int(0) string(1) "0" int(0) int(1) int(1) string(1) "1" int(1) array(0) { } bool(false) array(1) { [0]=> int(0) } bool(false) array(1) { [0]=> int(1) } bool(false) object(ToStringAble)#1 (0) { } int(0) object(stdClass)#1 (0) { } 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:
46.92 ms | 406 KiB | 5 Q