3v4l.org

run code in 300+ PHP versions simultaneously
<?php $asin = "B00ICQMBZG"; if (strlen($asin) == 13) { $odd = 0; $even = 0; $asinChar = str_split("978" . $asin); for ($i = 0; $i < 12; $i++) { if (($i % 2) !== 1) { $odd = $odd + $asinChar[$i]; } else { $even = $even + $asinChar[$i]; } } $sum = $odd + ($even * 3); $i = -1; do { $i++; $checksum = ceil($sum + $i) - $sum; } while (ceil($sum + $i) % 10 != 0); } else { $asinChar = str_split($asin); $num = 0; /** Zehnstellige ISBN Nummern bzw. Asins */ for ($i = 0; $i < 9; $i++) { $num = $num + ($asinChar[$i] * ($i + 1)); } $checksum = fmod($num, 11); } echo "978" . substr($asin, 0, 9) . $checksum;
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught TypeError: Unsupported operand types: string * int in /in/7OYaB:30 Stack trace: #0 {main} thrown in /in/7OYaB on line 30
Process exited with code 255.

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