3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkisbn($isbn) { $isbn10 = ereg_replace("[^0-9X]","",$isbn); $checkdigit = 11 - ( ( 10 * substr($isbn10,0,1) + 9 * substr($isbn10,1,1) + 8 * substr($isbn10,2,1) + 7 * substr($isbn10,3,1) + 6 * substr($isbn10,4,1) + 5 * substr($isbn10,5,1) + 4 * substr($isbn10,6,1) + 3 * substr($isbn10,7,1) + 2 * substr($isbn10,8,1) ) % 11); if ( $checkdigit == 10 ) $checkdigit = "X"; if ( $checkdigit == 11 ) $checkdigit = 0; if ( $checkdigit == substr($isbn10,9,1) ) { return true; } else { return false; } } if(checkisbn($isbn = $_GET['isbn'])) { header("Location: http://ad.zanox.com/ppc/?22806504C1206851698T&ULP=".$_GET['isbn']); } else { die('Fehlerhafte ISBN'); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key "isbn" in /in/aD2WN on line 14 Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /in/aD2WN:3 Stack trace: #0 /in/aD2WN(14): checkisbn(NULL) #1 {main} thrown in /in/aD2WN on line 3
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:
35.01 ms | 401 KiB | 8 Q