3v4l.org

run code in 300+ PHP versions simultaneously
<?php include 'Mailer.php'; include 'Validator.php'; define("PREIS_PRO_250G", 6.20); define("PREIS_PRO_500G", 10.50); define("PORTO", 5.50); function calculateTotalPrice($menge250g, $menge500g) { $totalPrice = (PREIS_PRO_250G * $menge250g) + (PREIS_PRO_500G * $menge500g) + PORTO; $totalPrice = sprintf("%.2f", $totalPrice); return $totalPrice; } function createOKMessage($totalPrice){ $msg = '<span style="color:green"><br />Vielen Dank für Ihre Bestellung, wir werden Sie sofort nach Geldeingang bearbeiten!<br />Bitte überweisen Sie den Betrag von '; $msg .= $totalPrice; $msg .= ' EURO auf das in der E-Mail angegebene Konto.<br />'; return $msg; } function createCalcMessage($totalPrice){ $msg = '<span style="color:green"><br />Ihre aktuelle Bestellung würde '; $msg .= $totalPrice; $msg .= ' EURO kosten.<br />'; return $msg; } $name = trim(strip_tags($_POST['name'])); $email = trim(strip_tags($_POST['email'])); $strasse = trim(strip_tags($_POST['strasse'])); $plz = trim(strip_tags($_POST['plz'])); $stadt = trim(strip_tags($_POST['stadt'])); $menge250g = trim(strip_tags($_POST['menge250g'])); $menge500g = trim(strip_tags($_POST['menge500g'])); if (!isset($menge250g) or $menge250g == ""){ $menge250g = 0; } if (!isset($menge500g) or $menge500g == ""){ $menge500g = 0; } $message = NULL; $validator = new Validator(); if(isset($_POST['submit'])){ // Eingabe validieren $valid = $validator->validateInput($name, $email, $strasse, $plz, $stadt, $menge250g, $menge500g); if($valid){ // Konnte die Eingabe erfolgreich validiert werden, wird der entdgueltige Preis berechnet und // die Email an den Kunden versendet $totalPrice = calculateTotalPrice($menge250g, $menge500g); Mailer::sendToCustomer($name, $email, $strasse, $plz, $stadt, $menge250g, $menge500g, $totalPrice); $message = createOKMessage($totalPrice); $name = ""; $email = ""; $strasse = ""; $plz = ""; $stadt = ""; $menge250g = 0; $menge500g = 0; } else{ // Im Fehlerfall werden die Fehlermeldungen ausgegeben $message = $validator->getErrorMessages(); } } if(isset($_POST['calc'])){ $totalPrice = calculateTotalPrice($menge250g, $menge500g); $message = createCalcMessage($totalPrice); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; } .Stil3 { font-size: 10px } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .Stil4 { color: #000000; background-image: none; background-position: left top; } --> </style> </head> <body style="background-color: transparent;"> <form name="Bestellformular" action="<? echo $_SERVER['file:///PHP_SELF']; ?>" method="post"> <table width="380" align="left"> <tr> <td width="160"><strong>Ihr Name:</strong></td> <td width="208"><input name="name" type="text" value="<? echo $name; ?>" size="26" maxlength="100" /></td> </tr> <tr> <td width="160"><strong>E-Mail:</strong><br /> </td> <td><input name="email" type="text" id="email" value="<? echo $email; ?>" size="26" maxlength="100" /></td> </tr> <tr> <td width="160">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="160"><strong>Lieferanschrift</strong><br /> </td> <td>&nbsp;</td> </tr> <tr> <td width="160"><strong>Strasse / Hausnummer</strong><br /> </td> <td><input name="strasse" type="text" id="strasse" value="<? echo $strasse; ?>" size="26" maxlength="100" /></td> </tr> <tr> <td width="160"><strong>Postleitzahl</strong><br /> </td> <td><input name="plz" type="text" id="plz" value="<? echo $plz; ?>" size="26" maxlength="5" /></td> </tr> <tr> <td width="160"><strong>Stadt</strong><br /> </td> <td><input name="stadt" type="text" id="stadt" value="<? echo $stadt; ?>" size="26" maxlength="100" /></td> </tr> <tr> <td width="160">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><strong>Päckchen</strong><br /> </td> <td>&nbsp;</td> </tr> <tr> <td><strong>Menge a 250g zu je 6,20€:</strong><br /> </td> <td><input name="menge250g" type="text" id="menge250g" value="<? echo $menge250g; ?>" size="26" maxlength="1" /></td> </tr> <tr> <td><strong>Menge a 500g zu je 10,50€:</strong><br /> </td> <td><input name="menge500g" type="text" id="menge500g" value="<? echo $menge500g; ?>" size="26" maxlength="1" /></td> </tr> <tr> <td width="160">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="160"><strong>Versandpauschale 5,50€</strong></td> <td>&nbsp;</td> </tr> <tr> <td width="160">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td colspan="2"><?echo $message;?></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="Abschicken" name="submit" /></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="Berechnen" name="calc" /></td> </tr> </table> </form> </body> </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.70.0120.00316.49
8.3.60.0100.01016.75
8.3.50.0110.00922.13
8.3.40.0120.00318.96
8.3.30.0030.01319.17
8.3.20.0080.00020.43
8.3.10.0080.00021.91
8.3.00.0080.00020.62
8.2.190.0130.00317.00
8.2.180.0180.00418.66
8.2.170.0040.01122.96
8.2.160.0030.01022.09
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0000.00819.01
8.2.110.0090.00022.05
8.2.100.0090.00317.63
8.2.90.0000.00819.17
8.2.80.0050.00317.97
8.2.70.0070.00717.63
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0030.00519.95
8.2.30.0000.00718.07
8.2.20.0080.00017.83
8.2.10.0040.00418.22
8.2.00.0060.00317.75
8.1.280.0120.00925.92
8.1.270.0090.00020.50
8.1.260.0080.00326.35
8.1.250.0060.00328.09
8.1.240.0000.00823.98
8.1.230.0090.00319.14
8.1.220.0050.00318.01
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0060.00318.45
8.1.160.0040.00422.07
8.1.150.0000.00718.83
8.1.140.0040.00417.47
8.1.130.0040.00417.81
8.1.120.0070.00017.38
8.1.110.0000.00717.42
8.1.100.0040.00417.48
8.1.90.0060.00317.58
8.1.80.0040.00417.50
8.1.70.0030.00317.50
8.1.60.0000.00917.66
8.1.50.0080.00017.66
8.1.40.0030.00617.54
8.1.30.0000.00917.82
8.1.20.0000.00817.69
8.1.10.0090.00017.52
8.1.00.0080.00017.64
8.0.300.0040.00418.77
8.0.290.0070.00016.88
8.0.280.0070.00018.57
8.0.270.0040.00417.45
8.0.260.0000.00717.39
8.0.250.0000.00717.13
8.0.240.0080.00017.14
8.0.230.0030.00317.13
8.0.220.0070.00016.98
8.0.210.0040.00716.97
8.0.200.0070.00017.03
8.0.190.0080.00017.20
8.0.180.0050.00217.12
8.0.170.0040.00417.01
8.0.160.0030.00617.05
8.0.150.0040.00416.91
8.0.140.0070.00017.07
8.0.130.0000.00713.42
8.0.120.0000.00816.94
8.0.110.0000.00717.04
8.0.100.0070.00017.15
8.0.90.0000.00816.98
8.0.80.0080.00817.04
8.0.70.0000.00716.95
8.0.60.0000.00816.92
8.0.50.0050.00316.99
8.0.30.0080.00817.29
8.0.20.0230.00817.46
8.0.10.0000.00817.05
8.0.00.0090.01217.00
7.4.330.0000.00515.14
7.4.320.0000.00816.55
7.4.300.0070.00016.58
7.4.290.0000.00716.64
7.4.280.0050.00516.50
7.4.270.0000.00816.50
7.4.260.0030.00716.63
7.4.250.0000.00816.65
7.4.240.0040.00416.61
7.4.230.0000.00716.66
7.4.220.0100.01316.63
7.4.210.0030.01216.70
7.4.200.0000.00716.76
7.4.160.0150.00616.47
7.4.150.0040.01617.40
7.4.140.0120.00517.86
7.4.130.0060.01116.60
7.4.120.0060.01116.64
7.4.110.0090.01116.75
7.4.100.0090.00916.48
7.4.90.0100.00716.49
7.4.80.0060.01016.48
7.4.70.0130.00716.63
7.4.60.0100.00716.55
7.4.50.0000.00416.48
7.4.40.0100.00716.50
7.4.30.0160.00316.55
7.4.00.0050.01115.04
7.3.330.0000.00513.53
7.3.320.0050.01113.42
7.3.310.0040.00416.58
7.3.300.0000.00716.42
7.3.290.0080.00716.52
7.3.280.0110.00816.51
7.3.270.0110.00717.40
7.3.260.0100.01316.48
7.3.250.0210.01416.44
7.3.240.0060.00916.50
7.3.230.0130.01016.59
7.3.210.0030.01316.57
7.3.200.0170.00719.39
7.3.190.0090.00616.61
7.3.180.0060.00916.66
7.3.170.0060.01716.45
7.3.160.0110.00716.55
7.3.120.0060.00615.00
7.3.110.0030.01614.94
7.3.100.0070.01015.02
7.3.90.0070.01114.89
7.3.80.0000.01114.99
7.3.70.0030.01014.83
7.3.60.0000.00914.75
7.3.50.0030.00614.94
7.3.40.0070.00714.74
7.3.30.0000.00815.00
7.3.20.0110.00416.80
7.3.10.0070.00716.78
7.3.00.0070.00716.73
7.2.330.0210.01916.96
7.2.320.0060.01216.60
7.2.310.0100.01016.47
7.2.300.0070.01716.90
7.2.290.0120.00616.59
7.2.250.0070.01115.25
7.2.240.0090.00914.72
7.2.230.0040.01215.16
7.2.220.0030.01215.20
7.2.210.0040.00715.07
7.2.200.0030.00714.94
7.2.190.0120.00315.00
7.2.180.0100.00015.28
7.2.170.0030.00615.17
7.2.160.0040.00414.97
7.2.150.0030.00916.72
7.2.140.0040.01416.76
7.2.130.0060.00917.05
7.2.120.0060.01216.89
7.2.110.0110.00416.89
7.2.100.0060.00616.61
7.2.90.0000.01616.98
7.2.80.0040.01216.72
7.2.70.0110.00717.11
7.2.60.0050.01017.03
7.2.50.0060.00916.81
7.2.40.0040.01216.78
7.2.30.0060.00617.07
7.2.20.0080.00416.80
7.2.10.0030.00817.13
7.2.00.0030.01016.99
7.1.330.0090.00915.89
7.1.320.0090.00315.89
7.1.310.0030.00915.94
7.1.300.0000.01715.88
7.1.290.0070.00715.86
7.1.280.0030.00616.00
7.1.270.0070.00715.85
7.1.260.0000.01516.01
7.1.250.0060.00915.90
7.1.240.0100.00315.77
7.1.230.0000.01415.85
7.1.220.0030.00616.00
7.1.210.0070.00715.96
7.1.200.0050.00915.73
7.1.190.0060.00615.72
7.1.180.0130.00315.75
7.1.170.0060.00615.87
7.1.160.0030.00615.64
7.1.150.0070.00315.91
7.1.140.0070.00715.78
7.1.130.0100.00315.72
7.1.120.0000.01415.54
7.1.110.0030.01415.67
7.1.100.0000.01015.99
7.1.90.0030.01315.73
7.1.80.0090.00615.84
7.1.70.0000.01216.52
7.1.60.0050.01117.65
7.1.50.0050.01316.34
7.1.40.0040.00715.93
7.1.30.0030.01015.66
7.1.20.0000.01415.82
7.1.10.0000.01115.78
7.1.00.0030.04219.04
7.0.330.0110.00415.38
7.0.320.0040.00815.54
7.0.310.0030.00615.14
7.0.300.0030.00715.40
7.0.290.0060.00615.36
7.0.280.0090.00615.24
7.0.270.0000.00815.32
7.0.260.0000.01115.35
7.0.250.0060.00615.45
7.0.240.0060.00615.18
7.0.230.0090.00915.39
7.0.220.0100.00615.31
7.0.210.0000.01715.54
7.0.200.0020.00815.97
7.0.190.0070.00715.27
7.0.180.0070.00315.54
7.0.170.0110.00315.32
7.0.160.0000.01415.36
7.0.150.0050.00315.64
7.0.140.0060.04118.73
7.0.130.0060.00615.47
7.0.120.0070.00715.42
7.0.110.0120.03017.81
7.0.100.0120.02717.75
7.0.90.0130.04317.71
7.0.80.0140.03917.81
7.0.70.0210.01917.59
7.0.60.0130.03717.84
7.0.50.0080.04518.02
7.0.40.0080.04016.84
7.0.30.0030.04516.78
7.0.20.0030.05316.72
7.0.10.0070.03716.85
7.0.00.0080.03316.96
5.6.400.0030.01214.42
5.6.390.0070.00714.57
5.6.380.0090.00614.73
5.6.370.0040.00414.77
5.6.360.0040.00714.62
5.6.350.0030.00914.54
5.6.340.0070.00314.60
5.6.330.0080.00514.54
5.6.320.0030.01014.30
5.6.310.0090.00014.88
5.6.300.0090.00314.44
5.6.290.0000.01314.60
5.6.280.0090.03617.80
5.6.270.0000.01514.43
5.6.260.0100.03617.60
5.6.250.0050.04017.54
5.6.240.0070.03817.49
5.6.230.0100.03817.49
5.6.220.0080.04517.63
5.6.210.0070.04317.39
5.6.200.0030.02717.71
5.6.190.0090.04017.88
5.6.180.0140.03417.74
5.6.170.0000.03417.78
5.6.160.0110.03917.88
5.6.150.0060.04517.87
5.6.140.0070.04017.75
5.6.130.0100.04117.78
5.6.120.0080.04217.77
5.6.110.0100.02517.86
5.6.100.0030.04517.79
5.6.90.0060.04917.85
5.6.80.0080.04117.53
5.6.70.0090.03517.40
5.6.60.0080.03517.57
5.6.50.0110.03317.40
5.6.40.0010.02617.48
5.6.30.0050.04317.57
5.6.20.0100.04217.25
5.6.10.0030.03717.52
5.6.00.0080.02017.42
5.5.380.0080.04117.55
5.5.370.0140.03517.50
5.5.360.0020.03917.24
5.5.350.0050.02317.47
5.5.340.0070.04217.73
5.5.330.0080.04717.57
5.5.320.0070.04417.66
5.5.310.0070.03617.47
5.5.300.0080.04517.72
5.5.290.0050.04717.79
5.5.280.0080.02817.46
5.5.270.0100.04817.62
5.5.260.0070.04417.77
5.5.250.0060.04317.44
5.5.240.0070.04217.21
5.5.230.0080.04017.15
5.5.220.0080.02517.35
5.5.210.0130.03817.27
5.5.200.0130.03817.30
5.5.190.0020.03817.22
5.5.180.0050.04017.19
5.5.170.0040.00714.16
5.5.160.0030.04717.31
5.5.150.0030.04417.28
5.5.140.0030.04517.15
5.5.130.0120.03817.27
5.5.120.0070.04017.37
5.5.110.0050.02817.08
5.5.100.0100.03817.28
5.5.90.0070.04017.04
5.5.80.0050.04217.26
5.5.70.0100.03917.21
5.5.60.0110.03516.97
5.5.50.0090.03916.96
5.5.40.0000.04017.17
5.5.30.0100.03817.26
5.5.20.0060.02817.17
5.5.10.0110.04017.07
5.5.00.0020.04517.10
5.4.450.0020.04615.74
5.4.440.0030.04215.84
5.4.430.0050.04215.83
5.4.420.0070.02315.91
5.4.410.0030.04515.77
5.4.400.0050.02315.56
5.4.390.0100.03815.58
5.4.380.0020.02515.65
5.4.370.0050.04515.70
5.4.360.0050.04315.65
5.4.350.0060.03815.58
5.4.340.0100.03615.70
5.4.330.0040.00412.16
5.4.320.0140.03315.66
5.4.310.0030.02215.68
5.4.300.0060.03815.57
5.4.290.0010.02615.57
5.4.280.0030.03515.59
5.4.270.0050.03515.70
5.4.260.0030.02915.59
5.4.250.0000.04415.63
5.4.240.0090.02015.75
5.4.230.0110.03715.58
5.4.220.0130.03515.55
5.4.210.0020.02815.59
5.4.200.0070.04115.59
5.4.190.0100.02115.73
5.4.180.0080.03815.70
5.4.170.0090.03315.69
5.4.160.0030.02415.56
5.4.150.0020.04715.62
5.4.140.0070.04014.28
5.4.130.0000.04714.30
5.4.120.0000.04714.25
5.4.110.0000.04214.32
5.4.100.0070.04414.31
5.4.90.0050.03914.40
5.4.80.0120.03314.34
5.4.70.0050.04014.27
5.4.60.0050.04214.23
5.4.50.0110.03514.23
5.4.40.0050.03314.38
5.4.30.0060.03014.34
5.4.20.0080.02214.28
5.4.10.0080.03714.27
5.4.00.0070.03414.07
5.3.290.0070.07714.73
5.3.280.0030.07714.48
5.3.270.0030.04714.65
5.3.260.0100.06714.64
5.3.250.0070.03314.86
5.3.240.0070.08314.72
5.3.230.0030.04314.62
5.3.220.0200.06314.62
5.3.210.0000.08314.82
5.3.200.0030.08314.72
5.3.190.0070.05014.67
5.3.180.0100.04714.60
5.3.170.0100.07014.57
5.3.160.0070.07014.72
5.3.150.0130.03714.58
5.3.140.0030.08014.60
5.3.130.0070.04014.59
5.3.120.0100.06714.70
5.3.110.0070.07714.80
5.3.100.0070.07314.07
5.3.90.0100.07314.13
5.3.80.0000.07013.90
5.3.70.0070.07314.13
5.3.60.0070.07014.06
5.3.50.0100.07713.99
5.3.40.0100.07314.06
5.3.30.0070.06713.95
5.3.20.0130.07013.81
5.3.10.0070.07313.68
5.3.00.0100.06313.89
5.2.170.0030.06311.89
5.2.160.0000.07011.89
5.2.150.0070.03311.89
5.2.140.0030.06311.89
5.2.130.0170.04311.89
5.2.120.0070.05311.89
5.2.110.0100.05011.89
5.2.100.0130.05311.89
5.2.90.0030.05011.89
5.2.80.0070.06311.89
5.2.70.0000.05711.89
5.2.60.0100.06311.89
5.2.50.0030.06311.89
5.2.40.0000.06011.89
5.2.30.0030.06711.89
5.2.20.0070.05711.89
5.2.10.0070.06011.89
5.2.00.0130.03011.89
5.1.60.0070.05311.89
5.1.50.0070.05311.89
5.1.40.0030.05011.89
5.1.30.0070.06011.89
5.1.20.0070.05311.89
5.1.10.0070.04311.89
5.1.00.0130.03711.89
5.0.50.0000.03311.89
5.0.40.0030.02011.89
5.0.30.0070.06311.89
5.0.20.0070.04011.89
5.0.10.0000.04711.89
5.0.00.0000.05311.89
4.4.90.0070.03311.89
4.4.80.0070.03311.89
4.4.70.0030.03711.89
4.4.60.0070.03011.89
4.4.50.0000.03311.89
4.4.40.0000.05711.89
4.4.30.0030.03011.89
4.4.20.0000.03711.89
4.4.10.0030.03311.89
4.4.00.0000.03011.89
4.3.110.0030.03011.89
4.3.100.0030.02011.89
4.3.90.0030.02311.89
4.3.80.0000.04311.89
4.3.70.0030.03011.89
4.3.60.0000.03711.89
4.3.50.0030.03311.89
4.3.40.0000.05311.89
4.3.30.0030.03711.89
4.3.20.0000.04011.89
4.3.10.0000.04011.89
4.3.00.0030.03011.89

preferences:
16.53 ms | 401 KiB | 5 Q