3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "intval \t integer casting". PHP_EOL; echo intval(42) ."\t". (int)42 . PHP_EOL; echo intval(4.2) ."\t". (int)(4.2) . PHP_EOL; echo intval('42') ."\t". (int)('42') . PHP_EOL; echo intval('+42') ."\t". (int)('+42') . PHP_EOL; echo intval('-42') ."\t". (int)('-42') . PHP_EOL; echo intval(042) ."\t". (int)(042) . PHP_EOL; echo intval('042') ."\t". (int)('042') . PHP_EOL; echo intval(1e10) ."\t". (int)(1e10) . PHP_EOL; echo intval('1e10') ."\t". (int)('1e10') . PHP_EOL; echo intval(0x1A) ."\t". (int)(0x1A) . PHP_EOL; echo intval(42000000) ."\t". (int)(42000000) . PHP_EOL; echo intval(420000000000000000000) ."\t". (int)(420000000000000000000) . PHP_EOL; echo intval('420000000000000000000') ."\t". (int)('420000000000000000000') . PHP_EOL; echo intval(array()) ."\t". (int)(array()) . PHP_EOL; echo intval(array('foo', 'bar')) ."\t". (int)(array('foo', 'bar')) . PHP_EOL; echo intval(false) ."\t". (int)(false) . PHP_EOL; echo intval(true) ."\t". (int)(true) . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
intval integer casting 42 42 4 4 42 42 42 42 -42 -42 34 34 42 42 10000000000 10000000000 10000000000 10000000000 26 26 42000000 42000000 -4275113695319687168 -4275113695319687168 9223372036854775807 9223372036854775807 0 0 1 1 0 0 1 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:
55.66 ms | 406 KiB | 5 Q