3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!empty($_POST["register-user"])) { /* Form Required Field Validation */ foreach($_POST as $key=>$value) { if(empty($_POST[$key])) { $error_message = "Todos los datos son obligatorios. All Fields are required"; break; } } /* Password Matching Validation */ if($_POST['password'] != $_POST['confirm_password']){ $error_message = 'Las claves deben ser iguales. Passwords should be same<br>'; } /* Email Validation */ if(!isset($error_message)) { if (!filter_var($_POST["EMAIL"], FILTER_VALIDATE_EMAIL)) { $error_message = "El email no es válido. Invalid Email Address"; } } /* Validation to check if gender is selected */ if(!isset($error_message)) { if(!isset($_POST["GENERO"])) { $error_message = " Todos los datos son obligatorios. All Fields are required"; } } /* Validation to check if Terms and Conditions are accepted */ if(!isset($error_message)) { if(!isset($_POST["terms"])) { $error_message = "Debe aceptar las condiciones del registro"; } } if(!isset($error_message)) { require_once("dbcontroller.php"); $db_handle = new DBController(); $query = "INSERT INTO registered_users (CI, password, NOMBRE, APELLIDO, GENERO, FECHA-NACIMIENTO, DIRECCION, CP, CIUDAD, PAIS, CELULARA, CELULARB, EMAIL) VALUES ('" . $_POST["CI"] . "' , '" . $_POST["password"] . "' , '" . $_POST["NOMBRE"] . "' , '" . $_POST["APELLIDO"] . "' , '" . $_POST["GENERO"] . "' , ['" . $_POST["FECHA-NACIMIENTO"] . "' , '" . $_POST["DIRECCION"] . "' , '" . $_POST["CP"] . "' , '" . $_POST["CIUDAD"] . "' , '" . $_POST["PAIS"] . "' , '" . $_POST["CELULARA"] . "' , '" . $_POST["CELULARB"] . "' , '" . $_POST["EMAIL"] . "')"; $result = $db_handle->insertQuery($query); if(!empty($result)) { $error_message = ""; $success_message = "Felicitaciones. Has completado el registro correctamente. Congratulations. You have registered successfully!"; unset($_POST); } else { $error_message = "No se completado el registro. Vuelve a intentarlo. Problem in registration. Try Again!"; } } } ?> <html> <head> <title>Registro de Socios</title> <style> body{ width:610px; font-family:calibri; } .error-message { padding: 7px 10px; background: #fff1f2; border: #ffd5da 1px solid; color: #d6001c; border-radius: 4px; } .success-message { padding: 7px 10px; background: #cae0c4; border: #c3d0b5 1px solid; color: #027506; border-radius: 4px; } .demo-table { background: #d9eeff; width: 100%; border-spacing: initial; margin: 2px 0px; word-break: break-word; table-layout: auto; line-height: 1.8em; color: #333; border-radius: 4px; padding: 20px 40px; } .demo-table td { padding: 15px 0px; } .demoInputBox { padding: 10px 30px; border: #a9a9a9 1px solid; border-radius: 4px; } .btnRegister { padding: 10px 30px; background-color: #3367b2; border: 0; color: #FFF; cursor: pointer; border-radius: 4px; margin-left: 10px; } </style> </head> <body> <form name="frmRegistration" method="post" action=""> <table border="0" width="500" align="center" class="demo-table"> <?php if(!empty($success_message)) { ?> <div class="success-message"><?php if(isset($success_message)) echo $success_message; ?></div> <?php } ?> <?php if(!empty($error_message)) { ?> <div class="error-message"><?php if(isset($error_message)) echo $error_message; ?></div> <?php } ?> <tr> <td colspan="2" align="center"><strong>Datos de Acceso</strong></td> </tr> <tr> <td>CI</td> <td><input type="text" class="demoInputBox" name="CI" value="<?php if(isset($_POST['CI'])) echo $_POST['CI']; ?>"></td> </tr> <tr> <td>Password</td> <td><input type="password" class="demoInputBox" name="password" value=""></td> </tr> <tr> <td>Confirmar Password</td> <td><input type="password" class="demoInputBox" name="confirm_password" value=""></td> </tr> <tr> <td colspan="2" align="center"><strong>Datos Personales</strong></td> </tr> <tr> <td>Nombre</td> <td><input type="text" class="demoInputBox" name="NOMBRE" value="<?php if(isset($_POST['NOMBRE'])) echo $_POST['NOMBRE']; ?>"></td> </tr> <tr> <td>Apellido</td> <td><input type="text" class="demoInputBox" name="APELLIDO" value="<?php if(isset($_POST['APELLIDO'])) echo $_POST['APELLIDO']; ?>"></td> </tr> <tr> <td>Género</td> <td><input type="radio" name="GENERO" value="MASCULINO" <?php if(isset($_POST['GENERO']) && $_POST['GENERO']=="MASCULINO") { ?>checked<?php } ?>> MASCULINO <input type="radio" name="GENERO" value="FEMENINO" <?php if(isset($_POST['GENERO']) && $_POST['GENERO']=="FEMENINO") { ?>checked<?php } ?>> FEMENINO </td> </tr> <tr> <td>Fecha de Nacimiento</td> <td><input type="text" class="demoInputBox" name="FECHA-NACIMIENTO" value="<?php if(isset($_POST['FECHA-NACIMIENTO'])) echo $_POST['FECHA-NACIMIENTO']; ?>"></td> </tr> <tr> <td colspan="2" align="center"><strong>Datos de Contacto</strong></td> </tr> <tr> <td>Dirección</td> <td><input type="text" class="demoInputBox" name="DIRECCION" value="<?php if(isset($_POST['DIRECCION'])) echo $_POST['DIRECCION']; ?>"></td> </tr> <tr> <td>CP</td> <td><input type="text" class="demoInputBox" name="CP" value="<?php if(isset($_POST['CP'])) echo $_POST['CP']; ?>"></td> </tr> <tr> <td>Ciudad</td> <td><input type="text" class="demoInputBox" name="CIUDAD" value="<?php if(isset($_POST['CIUDAD'])) echo $_POST['CIUDAD']; ?>"></td> </tr> <tr> <td>País</td> <td><input type="text" class="demoInputBox" name="PAIS" value="<?php if(isset($_POST['PAIS'])) echo $_POST['PAIS']; ?>"></td> </tr> <tr> <td>Celular 1</td> <td><input type="text" class="demoInputBox" name="CELULARA" value="<?php if(isset($_POST['CELULARA'])) echo $_POST['CELULARA']; ?>"></td> </tr> <tr> <td>Celular 2</td> <td><input type="text" class="demoInputBox" name="CELULARB" value="<?php if(isset($_POST['CELULARB'])) echo $_POST['CELULARB']; ?>"></td> </tr> <tr> <td>Email</td> <td><input type="text" class="demoInputBox" name="EMAIL" value="<?php if(isset($_POST['EMAIL'])) echo $_POST['EMAIL']; ?>"></td> </tr> <tr> <td colspan="2" align="center"><strong>Datos de Afiliación</strong></td> </tr> <tr> <td>Número de Socio</td> <td>&nbsp;</td> </tr> <tr> <td>Fecha de Ingreso</td> <td>&nbsp;</td> </tr> <tr> <td>Vencimiento de Membresía</td> <td>&nbsp;</td> </tr> <tr> <td>Categoría</td> <td>&nbsp;</td> </tr> <tr> <td>Estado de Afiliación</td> <td>&nbsp;</td> </tr> <tr> <td colspan=2> <input type="checkbox" name="terms"> Al registrarme acepto las condiciones de afiliación al club <input type="submit" name="register-user" value="Registrarme" class="btnRegister"></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.60.0070.01116.74
8.3.50.0120.00316.23
8.3.40.0090.00618.83
8.3.30.0070.00718.67
8.3.20.0000.00820.09
8.3.10.0030.00521.85
8.3.00.0060.00317.66
8.2.180.0110.01116.85
8.2.170.0060.00922.96
8.2.160.0090.00620.34
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0060.00322.15
8.2.120.0040.00426.35
8.2.110.0050.00521.13
8.2.100.0040.00818.03
8.2.90.0060.00319.34
8.2.80.0080.00018.16
8.2.70.0000.00817.63
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0000.00922.33
8.2.30.0030.00621.05
8.2.20.0050.00218.21
8.2.10.0000.00717.97
8.2.00.0020.00518.09
8.1.280.0100.01025.92
8.1.270.0050.00323.96
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00621.15
8.1.230.0080.00417.64
8.1.220.0040.00417.78
8.1.210.0080.00018.77
8.1.200.0060.00317.34
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0000.00818.72
8.1.160.0040.00419.02
8.1.150.0000.00820.60
8.1.140.0040.00419.61
8.1.130.0030.00318.93
8.1.120.0070.00017.51
8.1.110.0040.00417.48
8.1.100.0070.00017.40
8.1.90.0040.00417.38
8.1.80.0070.00017.38
8.1.70.0030.00317.53
8.1.60.0040.00417.47
8.1.50.0030.00517.58
8.1.40.0040.00417.55
8.1.30.0040.00417.60
8.1.20.0040.00417.58
8.1.10.0030.00517.48
8.1.00.0080.00017.61
8.0.300.0030.00518.77
8.0.290.0070.00016.60
8.0.280.0080.00018.41
8.0.270.0070.00017.21
8.0.260.0030.00316.78
8.0.250.0000.00616.89
8.0.240.0000.00717.05
8.0.230.0060.00316.95
8.0.220.0000.00716.95
8.0.210.0040.00416.92
8.0.200.0040.00417.02
8.0.190.0000.00816.99
8.0.180.0040.00416.92
8.0.170.0040.00416.99
8.0.160.0040.00416.83
8.0.150.0000.00716.90
8.0.140.0040.00416.90
8.0.130.0030.00313.28
8.0.120.0000.00816.91
8.0.110.0040.00416.89
8.0.100.0030.00516.95
8.0.90.0000.00716.76
8.0.80.0140.00316.95
8.0.70.0020.00516.98
8.0.60.0000.00816.80
8.0.50.0040.00416.76
8.0.30.0110.00817.02
8.0.20.0130.01517.40
8.0.10.0050.00217.08
8.0.00.0050.01616.77
7.4.330.0000.00515.55
7.4.320.0000.00716.66
7.4.300.0030.00316.55
7.4.290.0030.00716.66
7.4.280.0000.00816.43
7.4.270.0040.00416.66
7.4.260.0050.00013.30
7.4.250.0040.00416.54
7.4.240.0040.00416.56
7.4.230.0000.00716.55
7.4.220.0140.00316.52
7.4.210.0070.00716.54
7.4.200.0050.00216.54
7.4.160.0070.01316.54
7.4.150.0080.01217.40
7.4.140.0140.00617.86
7.4.130.0120.01216.57
7.4.120.0130.00816.49
7.4.110.0100.00616.44
7.4.100.0170.00316.49
7.4.90.0130.00416.54
7.4.80.0080.00819.39
7.4.70.0120.00416.38
7.4.60.0100.01316.51
7.4.50.0080.00816.38
7.4.40.0130.00316.67
7.4.30.0110.00716.66
7.4.00.0040.01315.05
7.3.330.0050.00013.19
7.3.320.0020.00212.99
7.3.310.0050.00316.30
7.3.300.0070.00016.21
7.3.290.0050.01116.32
7.3.280.0050.01116.31
7.3.270.0130.00717.40
7.3.260.0160.00416.40
7.3.250.0100.01016.38
7.3.240.0080.00916.55
7.3.230.0090.00916.53
7.3.210.0090.00916.36
7.3.200.0080.01116.25
7.3.190.0040.01616.33
7.3.180.0130.00316.61
7.3.170.0130.00416.42
7.3.160.0130.00316.34
7.3.120.0060.01314.79
7.3.110.0030.01015.01
7.3.100.0030.01214.71
7.3.90.0030.01014.74
7.3.80.0000.01014.79
7.3.70.0070.01014.84
7.3.60.0040.00814.83
7.3.50.0120.00014.76
7.3.40.0030.00614.64
7.3.30.0090.00614.79
7.3.20.0070.00716.67
7.3.10.0080.00416.51
7.3.00.0070.00716.66
7.2.330.0090.00916.33
7.2.320.0070.01116.72
7.2.310.0080.00916.48
7.2.300.0120.00616.71
7.2.290.0100.00716.38
7.2.250.0030.01514.79
7.2.240.0090.00915.09
7.2.230.0070.00415.00
7.2.220.0070.01015.26
7.2.210.0060.00915.18
7.2.200.0120.00315.07
7.2.190.0030.00615.12
7.2.180.0100.00315.08
7.2.170.0030.00615.13
7.2.60.0100.00716.55
7.2.00.0090.00319.16
7.1.330.0060.00615.74
7.1.320.0040.00815.83
7.1.310.0000.01515.39
7.1.300.0040.00815.78
7.1.290.0030.00515.90
7.1.280.0060.00315.40
7.1.270.0070.00715.46
7.1.260.0070.00715.54
7.1.200.0120.00315.59
7.1.100.0060.00617.75
7.1.70.1200.01715.28
7.1.60.1200.02333.33
7.1.50.1530.01332.83
7.1.40.1270.01332.33
7.1.30.1700.02332.67
7.1.20.1630.01332.75
7.1.10.1230.01014.82
7.1.00.0100.01014.71
7.0.200.1730.01014.89
7.0.190.1870.01314.95
7.0.180.0830.01314.36
7.0.170.2100.01014.31
7.0.160.1770.02014.37
7.0.150.1100.00314.52
7.0.140.0970.01014.29
7.0.130.0530.00714.63
7.0.120.0070.00714.64
7.0.110.1430.01314.41
7.0.100.0770.00714.54
7.0.90.0330.01714.59
7.0.80.1600.01314.32
7.0.70.0030.01314.40
7.0.60.0170.01714.41
7.0.50.0630.01014.47
7.0.40.0030.01314.61
7.0.30.1900.01314.65
7.0.20.0030.01014.41
7.0.10.1570.01714.81
7.0.00.0100.01014.61

preferences:
47.55 ms | 401 KiB | 5 Q