3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This is the automatic DB push code // This value is pulled from the HTTP server $spaces=" "; $yikes ="!!!!!!!!"; $IPAddress = $_SERVER['1.2.3.4']; $dieClose = " </body> </html>\n"; if ( empty ( $_POST ) ) { die ( "No variables passed in on HTTP POST" . $dieClose );//GET variables have been set } //setup filters to prevent invalid data input and malicious code insertion $filters = array ( "eventid" => array ("filter"=>FILTER_VALIDATE_REGEXP, // STRING epoch date int followed by "_" followed by an IP address i.e.: "1384204604_172.16.198.48" "options"=>array("regexp"=>"/^([0-9]+)_(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/")), "oslist" => array ("filter"=>FILTER_VALIDATE_REGEXP, // STRING (alnum and "," only), CSV OS name list. i.e.: "win7x64,debianx64,dos" "options"=>array("regexp"=>"/^((([a-zA-Z0-9]+),)*)([a-zA-Z0-9_]+)$/")), "hostip" => array ("filter"=>FILTER_VALIDATE_IP), "state" => array ("filter"=>FILTER_VALIDATE_REGEXP, // STRING characters "s" and "e" ONLY!!! indicates "start" or "end" "options"=>array("regexp"=>"/^[se]$/")), "hddinfo" => array ("filter"=>FILTER_VALIDATE_REGEXP, // STRING (0-9 and "," only), CSV HDD size list in kB i.e. "12313,123123,1132" "options"=>array("regexp"=>"/^((\d+,)*)(\d+)$/")), "meminfo" => array ("filter"=>FILTER_SANITIZE_STRING), "cpuinfo" => array ("filter"=>FILTER_SANITIZE_STRING), "error" => array ("filter"=>FILTER_VALIDATE_INT, "options"=>array("min_range"=>0,"max_range"=>1024) ), ); $inputFields = filter_input_array(INPUT_POST, $filters); //var_dump($inputFields); //for debugging $DBfields=array("eventid", "oslist", "hostip", "state", "hddinfo", "meminfo", "cpuinfo", "error"); $Results =array(); //$keyvalue="eventid"; foreach ($DBfields as &$keyvalue) { if (!$inputFields[$keyvalue]) { die($yikes . $keyvalue . "=" . $_POST[$keyvalue] . " invalid" . $yikes . $dieClose); } else { //echo($spaces . "Got a valid " . $keyvalue . "=" . $inputFields[$keyvalue] . "\n" ); //for debugging $Results[$keyvalue] = $inputFields[$keyvalue]; } } $MyQuery = "INSERT INTO `clonestats`.`stattable` ( `eventid`, `oslist`, `hostip`, `state`, `hddinfo`, `meminfo`, `cpuinfo`, `error` ) " . "VALUES ( '" . $Results['eventid'] . "', '" . $Results['oslist'] . "', '" . $IPAddress . ", " . $Results['hostip'] . "','" . $Results['state'] . "', '" . $Results['hddinfo'] . "', '" . $Results['meminfo'] . "', '" . $Results['cpuinfo'] . "', '" . $Results['error'] . "' );"; //echo("my query is \n\t$MyQuery"); //for debugging only $NewDBConnection = mysql_connect ( "localhost", "CloneStatPush", "5a97114c932162a11622eb34cb2589586ffa70fb7ee85d267c8dc06ba3de2a9c" ); if (!$NewDBConnection) { die ( "\n".$yikes." I didn't successfully connect to the database" . $yikes . $dieClose ); // link to DB is bad } else { mysql_select_db ( "clonestats" ); // echo $MyQuery; mysql_query ( $MyQuery ); echo mysql_affected_rows ( ); // Prints the result of the INSERT command, client doesn't need to do anything with it mysql_close ( $DBlink ); } ?>

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.0100.00616.88
8.3.50.0100.00616.58
8.3.40.0060.01218.77
8.3.30.0120.00318.70
8.3.20.0050.00318.82
8.3.10.0080.00018.80
8.3.00.0090.00019.38
8.2.180.0040.01116.75
8.2.170.0120.00322.96
8.2.160.0060.00918.96
8.2.150.0040.00424.18
8.2.140.0080.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00020.94
8.2.110.0030.00722.12
8.2.100.0000.01217.91
8.2.90.0060.00319.25
8.2.80.0030.00617.97
8.2.70.0050.00317.63
8.2.60.0080.00018.03
8.2.50.0050.00518.10
8.2.40.0040.00420.59
8.2.30.0080.00019.27
8.2.20.0030.00617.78
8.2.10.0080.00017.87
8.2.00.0060.00317.76
8.1.280.0100.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00622.75
8.1.230.0090.00317.77
8.1.220.0030.00617.74
8.1.210.0080.00318.77
8.1.200.0060.00317.38
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00818.62
8.1.160.0000.00718.97
8.1.150.0000.00718.92
8.1.140.0030.00517.54
8.1.130.0030.00317.48
8.1.120.0070.00017.50
8.1.110.0000.00817.55
8.1.100.0040.00417.46
8.1.90.0040.00417.48
8.1.80.0000.00717.50
8.1.70.0000.00717.51
8.1.60.0050.00317.61
8.1.50.0050.00317.55
8.1.40.0000.00917.55
8.1.30.0030.00517.70
8.1.20.0000.00817.56
8.1.10.0040.00417.61
8.1.00.0000.00917.43
8.0.300.0080.00018.77
8.0.290.0050.00316.75
8.0.280.0070.00018.44
8.0.270.0000.00817.17
8.0.260.0070.00016.96
8.0.250.0000.00817.07
8.0.240.0000.00717.03
8.0.230.0030.00517.00
8.0.220.0000.00616.87
8.0.210.0070.00016.90
8.0.200.0060.00017.05
8.0.190.0000.00717.09
8.0.180.0000.00717.02
8.0.170.0030.00517.04
8.0.160.0000.00717.02
8.0.150.0060.00316.79
8.0.140.0040.00416.95
8.0.130.0030.00313.45
8.0.120.0040.00416.91
8.0.110.0000.00816.88
8.0.100.0070.00016.88
8.0.90.0080.00017.05
8.0.80.0090.00616.93
8.0.70.0000.00716.98
8.0.60.0030.00516.90
8.0.50.0060.00317.01
8.0.30.0130.01017.39
8.0.20.0110.00817.40
8.0.10.0000.00717.05
8.0.00.0150.00716.65
7.4.330.0050.00013.08
7.4.320.0000.00616.69
7.4.300.0000.00716.56
7.4.290.0000.00816.64
7.4.280.0030.00616.59
7.4.270.0070.00316.61
7.4.260.0060.00013.42
7.4.250.0060.00316.67
7.4.240.0040.00416.55
7.4.230.0030.00316.38
7.4.220.0120.00916.60
7.4.210.0040.01716.48
7.4.200.0080.00016.61
7.4.190.0040.00416.70
7.4.160.0110.00716.61
7.4.150.0090.01316.73
7.4.140.0140.01017.86
7.4.130.0150.00616.82
7.4.120.0030.01416.64
7.4.110.0100.01016.45
7.4.100.0090.00916.53
7.4.90.0160.00316.56
7.4.80.0160.00319.39
7.4.70.0090.01216.56
7.4.60.0030.01316.65
7.4.50.0040.00016.51
7.4.40.0060.00916.59
7.4.30.0100.01016.46
7.4.00.0070.00715.07
7.3.330.0040.00413.22
7.3.320.0060.00013.23
7.3.310.0000.00716.26
7.3.300.0000.00716.35
7.3.290.0080.00816.32
7.3.280.0130.00516.42
7.3.270.0090.00916.48
7.3.260.0130.01016.38
7.3.240.0030.01316.31
7.3.230.0070.01016.35
7.3.210.0130.00316.45
7.3.200.0120.00916.46
7.3.190.0080.01116.39
7.3.180.0090.00916.64
7.3.170.0110.00816.58
7.3.160.0120.00316.40
7.3.120.0100.00715.01
7.2.330.0150.00916.39
7.2.320.0130.00416.57
7.2.310.0120.00616.63
7.2.300.0080.00916.51
7.2.290.0000.01716.73
7.2.00.0000.01319.25
7.1.200.0040.00915.78
7.1.100.0040.00818.45
7.1.70.0030.01017.29
7.1.60.0130.01019.25
7.1.50.0260.01034.77
7.1.00.0000.04022.36
7.0.200.0000.00716.60
7.0.140.0030.07322.04
7.0.120.0030.07322.13
7.0.60.0130.07319.95
7.0.50.0100.08317.91
7.0.40.0230.05720.27
7.0.30.0230.07020.09
7.0.20.0230.08020.27
7.0.10.0200.08320.23
7.0.00.0200.08320.39
5.6.280.0000.07321.08
5.6.210.0070.04320.55
5.6.200.0000.05718.19
5.6.190.0230.07720.32
5.6.180.0200.08320.56
5.6.170.0300.07720.67
5.6.160.0170.08020.62
5.6.150.0270.06720.37
5.6.140.0270.07020.34
5.6.130.0230.08320.18
5.6.120.0200.07020.35
5.6.110.0300.07020.09
5.6.100.0270.06320.33
5.6.90.0270.06720.32
5.6.80.0230.07719.70
5.6.70.0230.08019.81
5.6.60.0430.07319.48
5.6.50.0200.06319.76
5.6.40.0230.04719.54
5.6.30.0230.07019.73
5.6.20.0230.08019.48
5.6.10.0200.05319.48
5.6.00.0300.04319.71
5.5.350.0100.08720.46
5.5.340.0200.07018.02
5.5.330.0200.08320.36
5.5.320.0330.07320.26
5.5.310.0230.07720.40
5.5.300.0230.08320.18
5.5.290.0200.08019.98
5.5.280.0200.07020.21
5.5.270.0130.05320.13
5.5.260.0330.05020.07
5.5.250.0200.07719.90
5.5.240.0200.05319.59
5.5.230.0230.06019.46
5.5.220.0270.07719.49
5.5.210.0270.07719.52
5.5.200.0130.04719.59
5.5.190.0270.07319.58
5.5.180.0300.05319.60
5.5.160.0300.06719.26
5.5.150.0300.07319.32
5.5.140.0200.06719.55
5.5.130.0200.06719.24
5.5.120.0130.06019.27
5.5.110.0230.08319.25
5.5.100.0270.07019.18
5.5.90.0200.04019.23
5.5.80.0100.04319.42
5.5.70.0200.03719.32
5.5.60.0170.03719.32
5.5.50.0200.04019.48
5.5.40.0100.04019.43
5.5.30.0200.03019.25
5.5.20.0130.03719.14
5.5.10.0170.03319.43
5.5.00.0170.03319.45
5.4.450.0230.08019.42
5.4.440.0170.07719.35
5.4.430.0300.03719.40
5.4.420.0270.06719.13
5.4.410.0130.05319.12
5.4.400.0170.06718.92
5.4.390.0270.06019.00
5.4.380.0300.04318.81
5.4.370.0230.07018.92
5.4.360.0200.04019.09
5.4.350.0230.05019.18
5.4.340.0330.04318.81
5.4.320.0230.07319.18
5.4.310.0430.06018.93
5.4.300.0270.07018.91
5.4.290.0200.04319.14
5.4.280.0200.05719.02
5.4.270.0230.05319.18
5.4.260.0200.06719.14
5.4.250.0170.04019.07
5.4.240.0100.04318.88
5.4.230.0230.03019.14
5.4.220.0200.03018.99
5.4.210.0230.02719.20
5.4.200.0070.04319.11
5.4.190.0130.03719.13
5.4.180.0200.03019.07
5.4.170.0300.03718.78
5.4.160.0200.03019.06
5.4.150.0130.03718.90
5.4.140.0200.02716.33
5.4.130.0170.03316.16
5.4.120.0170.03016.19
5.4.110.0100.03716.31
5.4.100.0100.03716.23
5.4.90.0130.03316.61
5.4.80.0200.02716.40
5.4.70.0170.03016.27
5.4.60.0170.03016.28
5.4.50.0130.03716.26
5.4.40.0130.03316.26
5.4.30.0200.02716.26
5.4.20.0100.04016.39
5.4.10.0130.03316.34
5.4.00.0100.03715.82
5.3.290.0270.04714.62
5.3.280.0230.03714.70
5.3.270.0130.03714.55
5.3.260.0130.04314.56
5.3.250.0170.04014.64
5.3.240.0230.06014.55
5.3.230.0230.03314.63
5.3.220.0130.03714.43
5.3.210.0130.04014.52
5.3.200.0170.04014.60
5.3.190.0170.03314.67
5.3.180.0130.03714.46
5.3.170.0100.03714.54
5.3.160.0200.02714.51
5.3.150.0170.03314.51
5.3.140.0100.04014.52
5.3.130.0170.04014.50
5.3.120.0130.03714.54
5.3.110.0100.04014.53
5.3.100.0100.03713.96
5.3.90.0130.03713.99
5.3.80.0170.03313.96
5.3.70.0170.03313.86
5.3.60.0130.07313.81
5.3.50.0230.04014.05
5.3.40.0130.05713.94
5.3.30.0170.04013.75
5.3.20.0200.07013.73
5.3.10.0230.03713.61
5.3.00.0270.06713.59
5.2.170.0130.06312.45
5.2.160.0230.05312.45
5.2.150.0200.06012.45
5.2.140.0170.05312.45
5.2.130.0230.05012.45
5.2.120.0300.05012.45
5.2.110.0200.05312.45
5.2.100.0200.03712.45
5.2.90.0300.04312.45
5.2.80.0170.04012.45
5.2.70.0170.03012.45
5.2.60.0230.04312.45
5.2.50.0130.06312.45
5.2.40.0300.05312.45
5.2.30.0130.07012.45
5.2.20.0130.05012.45
5.2.10.0200.05012.45
5.2.00.0170.03312.45
5.1.60.0100.04012.45
5.1.50.0170.03712.45
5.1.40.0200.02712.45
5.1.30.0100.06312.45
5.1.20.0170.02312.45
5.1.10.0170.03012.45
5.1.00.0270.03312.45
5.0.50.0130.04012.45
5.0.40.0070.03012.45
5.0.30.0070.03012.45
5.0.20.0170.03012.45
5.0.10.0130.03712.45
5.0.00.0130.05712.45
4.4.90.0130.03012.45
4.4.80.0230.02012.45
4.4.70.0070.02312.45
4.4.60.0100.03312.45
4.4.50.0070.03712.45
4.4.40.0100.04712.45
4.4.30.0070.02312.45
4.4.20.0170.01012.45
4.4.10.0000.04312.45
4.4.00.0130.05012.45
4.3.110.0030.02012.45
4.3.100.0100.02012.45
4.3.90.0070.02712.45
4.3.80.0100.04712.45
4.3.70.0100.01712.45
4.3.60.0100.03012.45
4.3.50.0100.02712.45
4.3.40.0100.03012.45
4.3.30.0100.03012.45
4.3.20.0000.03712.45
4.3.10.0070.01312.45
4.3.00.0000.01712.45

preferences:
48.01 ms | 401 KiB | 5 Q