3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); var_dump(intdiv(3, 2)); var_dump(intdiv(-3, 2)); var_dump(intdiv(3, -2)); var_dump(intdiv(-3, -2)); var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX)); var_dump(intdiv(~PHP_INT_MAX, ~PHP_INT_MAX)); try { var_dump(intdiv(~PHP_INT_MAX, -1)); } catch (Throwable $e) { echo "Exception: " . $e->getMessage() . "\n"; } try { var_dump(intdiv(1, 0)); } catch (Throwable $e) { echo "Exception: " . $e->getMessage() . "\n"; } $result = ob_get_contents(); ob_end_clean(); $expectedOutput = <<<EOT int(1) int(-1) int(-1) int(1) int(1) int(1) Exception: Division of PHP_INT_MIN by -1 is not an integer Exception: Division by zero EOT; var_dump($expectedOutput); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
string(130) "int(1) int(-1) int(-1) int(1) int(1) int(1) Exception: Division of PHP_INT_MIN by -1 is not an integer Exception: Division by zero" string(131) "int(1) int(-1) int(-1) int(1) int(1) int(1) Exception: Division of PHP_INT_MIN by -1 is not an integer Exception: Division by zero "

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.96 ms | 402 KiB | 8 Q