3v4l.org

run code in 300+ PHP versions simultaneously
<?php function Kmod($bn, $sn) { return intval(fmod(floatval($bn), $sn)); } //整数取余方法 function mod($bn, $sn) { return $bn%$sn; } //最大的int整数 $bn = PHP_INT_MAX; $sn = 11; var_dump($bn); var_dump(Kmod($bn, $sn)); var_dump(mod($bn, $sn)); //给最大的int整数加1 当给最大的整型数加1之后,得到的$bn已经变为了浮点型。 $bn = PHP_INT_MAX + 1; var_dump($bn); var_dump(Kmod($bn, $sn)); var_dump(mod($bn, $sn));
Output for git.master, git.master_jit, rfc.property-hooks
int(9223372036854775807) int(8) int(7) float(9.223372036854776E+18) int(8) Deprecated: Implicit conversion from float 9.223372036854776E+18 to int loses precision in /in/Q8vEm on line 9 int(-8)

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