3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prefix = (string) 1234; $id = (string) 3; $number = $prefix . str_repeat('0', 12 - strlen($prefix) - strlen($id)) . $id; $odd = true; $checksum = 0; $key = range(0, 9); for ($i = strlen($number); $i > 0; $i--) { $checksum += $key[$number[$i - 1]] * (($odd = !$odd) ? 3 : 1); } $checksum = 10 - $checksum % 10; $checksum = ($checksum == 10) ? 0 : $checksum; echo $number . $checksum;
Output for git.master, git.master_jit, rfc.property-hooks
1234000000039

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.97 ms | 401 KiB | 8 Q