3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dataFormat = array( "dateTimeOfData" => "DateTime", "open" => "double", "high" => "double", "low" => "double", "close" => "double", "volume" => "integer", "isCritical" => "boolean"//Temporary ); function validateFormat($data){ global $dataFormat; //Check that all the required fields exist $missing = array_diff_key($dataFormat, $data); $extra = array_diff_key($data, $dataFormat); if(!empty($missing) || !empty($extra)){ throw new InvalidArgumentException("Incorrect data format provided"); } //Check that all the data is of the correct type foreach($data as $k => $v){ $type = gettype($v) === "object" ? get_class($v) : gettype($v); $correctType = $dataFormat[$k]; if($type !== $correctType){ throw new InvalidArgumentException("Data is of an incorrect type."); } } } $arr = array("dateTimeOfData" => new DateTime(), "open" => 10.1, "high" => 10.1, "low" => 10.1, "close" => 10.1, "volume" => 10, "isCritical" => true); validateFormat($arr);

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.0090.00916.50
8.3.60.0180.00018.56
8.3.50.0070.00921.23
8.3.40.0090.00619.10
8.3.30.0070.01418.84
8.3.20.0080.00020.30
8.3.10.0000.00823.65
8.3.00.0030.00622.51
8.2.190.0060.01218.55
8.2.180.0070.00716.88
8.2.170.0100.00622.96
8.2.160.0070.00720.34
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0060.00317.88
8.2.110.0040.00819.31
8.2.100.0090.00317.98
8.2.90.0060.00318.15
8.2.80.0080.00017.97
8.2.70.0040.00417.87
8.2.60.0040.00418.15
8.2.50.0000.00818.07
8.2.40.0040.00420.85
8.2.30.0030.00520.02
8.2.20.0040.00417.97
8.2.10.0050.00318.18
8.2.00.0050.00218.29
8.1.280.0110.00325.92
8.1.270.0040.00420.14
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00522.61
8.1.230.0070.00320.91
8.1.220.0000.00817.78
8.1.210.0030.00619.04
8.1.200.0000.01017.48
8.1.190.0080.00017.23
8.1.180.0050.00318.10
8.1.170.0030.00518.68
8.1.160.0050.00222.09
8.1.150.0060.00318.98
8.1.140.0000.00817.67
8.1.130.0030.00317.64
8.1.120.0000.00717.70
8.1.110.0000.00817.64
8.1.100.0040.00417.68
8.1.90.0030.00417.75
8.1.80.0050.00317.70
8.1.70.0030.00317.59
8.1.60.0000.00917.74
8.1.50.0000.00917.51
8.1.40.0030.00617.70
8.1.30.0030.00517.83
8.1.20.0040.00417.82
8.1.10.0050.00217.77
8.1.00.0000.00717.80
8.0.300.0060.00320.01
8.0.290.0040.00417.13
8.0.280.0000.00718.55
8.0.270.0000.00717.28
8.0.260.0030.00317.36
8.0.250.0040.00417.23
8.0.240.0000.00817.08
8.0.230.0040.00417.18
8.0.220.0030.00517.05
8.0.210.0070.00017.11
8.0.200.0040.00417.07
8.0.190.0080.00017.23
8.0.180.0000.00717.15
8.0.170.0040.00417.05
8.0.160.0040.00417.20
8.0.150.0080.00017.10
8.0.140.0000.00717.07
8.0.130.0000.00713.52
8.0.120.0080.00017.12
8.0.110.0040.00417.12
8.0.100.0040.00417.02
8.0.90.0070.00017.07
8.0.80.0060.00917.17
8.0.70.0040.00417.11
8.0.60.0070.00017.01
8.0.50.0000.00717.17
8.0.30.0090.00917.24
8.0.20.0130.00517.46
8.0.10.0050.00217.24
8.0.00.0080.00816.97
7.4.330.0000.00515.08
7.4.320.0000.00616.69
7.4.300.0060.00016.72
7.4.290.0080.00016.66
7.4.280.0060.00316.68
7.4.270.0030.00316.61
7.4.260.0040.00416.64
7.4.250.0050.00316.63
7.4.240.0020.00516.72
7.4.230.0030.00316.79
7.4.220.0030.01416.72
7.4.210.0070.00716.72
7.4.200.0000.00716.75
7.4.160.0000.01616.57
7.4.150.0110.00717.40
7.4.140.0080.01117.86
7.4.130.0090.01016.70
7.4.120.0080.01216.63
7.4.110.0040.01216.49
7.4.100.0110.00716.54
7.4.90.0040.01316.51
7.4.80.0090.01319.39
7.4.70.0060.01116.74
7.4.60.0100.00616.66
7.4.50.0040.00416.61
7.4.40.0120.00316.74
7.4.30.0120.00916.77
7.4.00.0100.00715.36
7.3.330.0030.00313.54
7.3.320.0000.00513.38
7.3.310.0000.00716.39
7.3.300.0030.00316.41
7.3.290.0080.00716.49
7.3.280.0080.01116.53
7.3.270.0140.00317.40
7.3.260.0130.00616.84
7.3.250.0120.00716.63
7.3.240.0160.00316.65
7.3.230.0100.01016.64
7.3.210.0100.00716.66
7.3.200.0130.00719.39
7.3.190.0100.00616.74
7.3.180.0100.00716.81
7.3.170.0080.00816.55
7.3.160.0140.00716.68
7.2.330.0120.00616.80
7.2.320.0090.00916.77
7.2.310.0160.00616.74
7.2.300.0100.00616.63
7.2.290.0070.01116.82
7.2.00.0090.00319.64
7.1.100.0040.00818.30
7.1.70.0000.00817.41
7.1.60.0040.00717.47
7.1.50.0100.00617.22
7.1.00.0030.07722.40
7.0.200.0000.00816.98
7.0.100.0330.08319.92
7.0.90.0000.08719.99
7.0.80.0070.08019.89
7.0.70.0030.07319.88
7.0.60.0070.08320.09
7.0.50.0100.08020.27
7.0.40.0070.07719.96
7.0.30.0130.05720.09
7.0.20.0030.05020.13
7.0.10.0070.04720.17
7.0.00.0170.07020.14
5.6.280.0030.04721.14
5.6.250.0100.06720.60
5.6.240.0170.08020.60
5.6.230.0130.07020.68
5.6.220.0030.04720.59
5.6.210.0070.07320.49
5.6.200.0070.08721.17
5.6.190.0130.07321.10
5.6.180.0070.07721.08
5.6.170.0100.04321.02
5.6.160.0030.05020.96
5.6.150.0130.08021.04
5.6.140.0100.05321.01
5.6.130.0030.08721.02
5.6.120.0130.05320.98
5.6.110.0130.06721.02
5.6.100.0130.07721.04
5.6.90.0070.04721.06
5.6.80.0030.06720.45
5.6.70.0130.03720.38
5.6.60.0070.09020.42
5.6.50.0100.07720.46
5.6.40.0100.04320.38
5.6.30.0100.07720.50
5.6.20.0030.06320.36
5.6.10.0130.03020.28
5.6.00.0070.08320.51
5.5.380.0070.08720.38
5.5.370.0170.06720.55
5.5.360.0170.07720.42
5.5.350.0100.07720.38
5.5.340.0070.08320.94
5.5.330.0100.04020.83
5.5.320.0030.04720.74
5.5.310.0000.07720.93
5.5.300.0100.04020.84
5.5.290.0030.06020.84
5.5.280.0100.08320.80
5.5.270.0130.07320.88
5.5.260.0130.07020.88
5.5.250.0130.07720.70
5.5.240.0030.07720.12
5.5.230.0100.08720.31
5.5.220.0000.05720.02
5.5.210.0100.07320.02
5.5.200.0170.07720.26
5.5.190.0070.07720.21
5.5.180.0030.05020.24
5.5.160.0070.04720.18
5.5.150.0000.05020.25
5.5.140.0100.04720.27
5.5.130.0070.08320.11
5.5.120.0130.07320.08
5.5.110.0030.09020.24
5.5.100.0200.04720.11
5.5.90.0070.07320.07
5.5.80.0100.03720.16
5.5.70.0100.07720.12
5.5.60.0030.05320.09
5.5.50.0030.07020.07
5.5.40.0030.08720.14
5.5.30.0030.06320.00
5.5.20.0130.07319.93
5.5.10.0070.08019.98
5.5.00.0070.04020.00
5.4.450.0000.04319.46
5.4.440.0100.06719.48
5.4.430.0100.07719.44
5.4.420.0070.08719.36
5.4.410.0070.06719.33
5.4.400.0170.06719.10
5.4.390.0070.07318.85
5.4.380.0070.04719.09
5.4.370.0070.04019.18
5.4.360.0100.03719.03
5.4.350.0100.06319.13
5.4.340.0030.04019.09
5.4.320.0100.05019.12
5.4.310.0070.04018.90
5.4.300.0100.07319.22
5.4.290.0130.05719.18
5.4.280.0030.06319.09
5.4.270.0000.06319.11
5.4.260.0200.05018.95
5.4.250.0030.07719.02
5.4.240.0200.02319.08
5.4.230.0070.07019.02
5.4.220.0130.06718.84
5.4.210.0030.07718.94
5.4.200.0030.05319.11
5.4.190.0130.06719.03
5.4.180.0000.07019.08
5.4.170.0130.07018.89
5.4.160.0070.06018.86
5.4.150.0100.05719.10
5.4.140.0170.03316.41
5.4.130.0100.07016.41
5.4.120.0030.03716.38
5.4.110.0070.07316.43
5.4.100.0000.07716.46
5.4.90.0170.05316.27
5.4.80.0070.07316.50
5.4.70.0070.07316.45
5.4.60.0100.07316.36
5.4.50.0100.06016.48
5.4.40.0130.06716.35
5.4.30.0130.06316.43
5.4.20.0100.05016.47
5.4.10.0070.07016.40
5.4.00.0100.05315.86
5.3.290.0030.08014.64
5.3.280.0070.07714.53
5.3.270.0000.05314.70
5.3.260.0000.07714.67
5.3.250.0030.05314.55
5.3.240.0030.04014.70
5.3.230.0030.03714.65
5.3.220.0070.07314.59
5.3.210.0100.07714.60
5.3.200.0070.07314.51
5.3.190.0070.04314.56
5.3.180.0070.04014.63
5.3.170.0030.08314.71
5.3.160.0100.04014.59
5.3.150.0030.05314.55
5.3.140.0000.07314.48
5.3.130.0100.06314.61
5.3.120.0100.06714.60
5.3.110.0070.07714.47
5.3.100.0070.05714.14
5.3.90.0070.06313.97
5.3.80.0030.06314.08
5.3.70.0100.04013.96
5.3.60.0070.07713.93
5.3.50.0100.06714.00
5.3.40.0000.05013.87
5.3.30.0000.07313.96
5.3.20.0100.06713.62
5.3.10.0030.03713.71
5.3.00.0100.03713.70
5.2.170.0030.03711.06
5.2.160.0000.02711.21
5.2.150.0070.05011.01
5.2.140.0070.06011.00
5.2.130.0030.06710.96
5.2.120.0130.03711.01
5.2.110.0030.05311.04
5.2.100.0100.06011.05
5.2.90.0070.06311.26
5.2.80.0000.03311.00
5.2.70.0070.03011.16
5.2.60.0030.02710.96
5.2.50.0070.04311.08
5.2.40.0030.03710.89
5.2.30.0070.03310.90
5.2.20.0100.05011.06
5.2.10.0130.04710.98
5.2.00.0030.06310.78
5.1.60.0000.03010.10
5.1.50.0070.0409.99
5.1.40.0000.0339.98
5.1.30.0070.02310.32
5.1.20.0070.05010.42
5.1.10.0030.04310.06
5.1.00.0030.04710.18
5.0.50.0030.0508.61
5.0.40.0000.0378.33
5.0.30.0030.0578.33
5.0.20.0030.0278.33
5.0.10.0000.0378.33
5.0.00.0000.0678.33
4.4.90.0070.0138.33
4.4.80.0070.0238.33
4.4.70.0000.0408.33
4.4.60.0000.0278.33
4.4.50.0030.0178.33
4.4.40.0000.0538.33
4.4.30.0070.0138.33
4.4.20.0000.0378.33
4.4.10.0030.0338.33
4.4.00.0030.0478.33
4.3.110.0000.0338.33
4.3.100.0030.0178.33
4.3.90.0000.0178.33
4.3.80.0000.0578.33
4.3.70.0000.0208.33
4.3.60.0100.0278.33
4.3.50.0030.0178.33
4.3.40.0070.0378.33
4.3.30.0000.0238.33
4.3.20.0070.0308.33
4.3.10.0030.0138.33
4.3.00.0030.0238.33

preferences:
56.87 ms | 401 KiB | 5 Q