3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertVersionId($versionId, $base) { return sprintf( '%d.%d.%d', $versionId / ($base * $base), ($versionId / $base) % $base, $versionId % $base ); } function convertVersionIdFixed($versionId, $base) { return sprintf( '%d.%d.%d', $versionId / ($base * $base), (int) ($versionId / $base) % $base, $versionId % $base ); } var_dump(convertVersionId(30411, 100)); var_dump(convertVersionId(20449, 100)); echo '-----------', PHP_EOL; var_dump(convertVersionIdFixed(30411, 100)); var_dump(convertVersionIdFixed(20449, 100));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 304.11 to int loses precision in /in/1fr2g on line 8 string(6) "3.4.11" Deprecated: Implicit conversion from float 204.49 to int loses precision in /in/1fr2g on line 8 string(6) "2.4.49" ----------- string(6) "3.4.11" string(6) "2.4.49"

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:
24.2 ms | 406 KiB | 5 Q