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){ //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.60.0120.00318.58
8.3.50.0000.01416.42
8.3.40.0090.00618.95
8.3.30.0190.00318.96
8.3.20.0070.00722.09
8.3.10.0040.00423.64
8.3.00.0040.00422.44
8.2.180.0120.00616.88
8.2.170.0090.00622.96
8.2.160.0070.00720.45
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0030.00517.75
8.2.110.0030.00619.14
8.2.100.0040.00817.75
8.2.90.0040.00419.17
8.2.80.0030.00617.97
8.2.70.0040.00417.59
8.2.60.0080.00018.04
8.2.50.0050.00318.07
8.2.40.0100.00021.19
8.2.30.0050.00218.20
8.2.20.0040.00417.93
8.2.10.0000.00818.02
8.2.00.0040.00418.16
8.1.280.0040.01125.92
8.1.270.0080.00020.29
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0070.00323.92
8.1.230.0050.00517.48
8.1.220.0060.00317.76
8.1.210.0080.00018.77
8.1.200.0030.00617.48
8.1.190.0040.00417.50
8.1.180.0090.00018.10
8.1.170.0040.00418.70
8.1.160.0000.00721.90
8.1.150.0060.00318.79
8.1.140.0000.00817.61
8.1.130.0030.00317.66
8.1.120.0000.00717.68
8.1.110.0040.00417.61
8.1.100.0000.00817.67
8.1.90.0040.00417.50
8.1.80.0050.00217.70
8.1.70.0030.00317.58
8.1.60.0000.00817.68
8.1.50.0030.00617.58
8.1.40.0000.00817.57
8.1.30.0040.00417.84
8.1.20.0030.00617.79
8.1.10.0040.00417.73
8.1.00.0000.00817.63
8.0.300.0000.00818.77
8.0.290.0040.00417.00
8.0.280.0000.00718.43
8.0.270.0040.00417.36
8.0.260.0030.00317.35
8.0.250.0030.00517.20
8.0.240.0000.00817.25
8.0.230.0030.00417.21
8.0.220.0030.00317.18
8.0.210.0030.00517.00
8.0.200.0000.00617.21
8.0.190.0000.00817.23
8.0.180.0040.00417.03
8.0.170.0030.00517.13
8.0.160.0000.00817.14
8.0.150.0030.00617.09
8.0.140.0000.00717.02
8.0.130.0020.00513.47
8.0.120.0030.00516.98
8.0.110.0040.00417.12
8.0.100.0050.00317.19
8.0.90.0040.00417.08
8.0.80.0070.01017.16
8.0.70.0000.00817.14
8.0.60.0040.00417.08
8.0.50.0040.00417.12
8.0.30.0140.00817.32
8.0.20.0090.01017.40
8.0.10.0040.00417.10
8.0.00.0100.00817.01
7.4.330.0000.00515.18
7.4.320.0040.00416.82
7.4.300.0030.00316.79
7.4.290.0050.00316.59
7.4.280.0000.00716.77
7.4.270.0030.00316.78
7.4.260.0070.00016.73
7.4.250.0000.00716.54
7.4.240.0000.00716.72
7.4.230.0030.00316.55
7.4.220.0130.01016.80
7.4.210.0000.01416.63
7.4.200.0000.00716.63
7.4.160.0100.00716.71
7.4.150.0120.00617.40
7.4.140.0100.01017.86
7.4.130.0120.00616.90
7.4.120.0100.00816.75
7.4.110.0070.01016.73
7.4.100.0060.01516.57
7.4.90.0070.01716.66
7.4.80.0070.01419.39
7.4.70.0110.00716.92
7.4.60.0070.01116.79
7.4.50.0000.00416.76
7.4.40.0160.00016.79
7.4.30.0070.01016.56
7.4.00.0060.01115.33
7.3.330.0030.00313.55
7.3.320.0030.00313.65
7.3.310.0000.00716.49
7.3.300.0030.00316.45
7.3.290.0060.01116.63
7.3.280.0060.01016.60
7.3.270.0040.01317.40
7.3.260.0120.00616.61
7.3.250.0170.00516.68
7.3.240.0140.00516.48
7.3.230.0100.01016.72
7.3.210.0080.00816.64
7.3.200.0030.01319.39
7.3.190.0100.00716.61
7.3.180.0030.01316.77
7.3.170.0080.00816.79
7.3.160.0130.00616.88
7.3.120.0050.01015.09
7.3.110.0080.00714.98
7.3.100.0090.00615.02
7.3.90.0040.01114.72
7.3.80.0040.00715.04
7.3.70.0060.01014.95
7.3.60.0080.01014.96
7.3.50.0080.00514.95
7.3.40.0040.01115.13
7.3.30.0030.01214.94
7.3.20.0070.00416.91
7.3.10.0020.01016.77
7.3.00.0050.00916.80
7.2.330.0060.01216.66
7.2.320.0130.00316.76
7.2.310.0030.01417.05
7.2.300.0080.00817.02
7.2.290.0070.01516.86
7.2.250.0070.01115.27
7.2.240.0050.00915.21
7.2.230.0030.01015.26
7.2.220.0040.00915.23
7.2.210.0050.01215.34
7.2.200.0090.00815.20
7.2.190.0030.01315.29
7.2.180.0030.00915.29
7.2.170.0070.01015.26
7.2.160.0100.00315.27
7.2.150.0060.00916.87
7.2.140.0080.00416.94
7.2.130.0130.00317.20
7.2.120.0070.00717.08
7.2.110.0030.01416.98
7.2.100.0070.00716.69
7.2.90.0070.00717.18
7.2.80.0030.00916.87
7.2.70.0130.00016.96
7.2.60.0090.00617.00
7.2.50.0120.00317.21
7.2.40.0080.00317.16
7.2.30.0030.01017.23
7.2.20.0040.00817.05
7.2.10.0070.00717.06
7.2.00.0020.01418.22
7.1.330.0060.00715.85
7.1.320.0080.00515.93
7.1.310.0020.01115.98
7.1.300.0050.00815.91
7.1.290.0040.00615.80
7.1.280.0100.00615.84
7.1.270.0050.01116.06
7.1.260.0090.00516.00
7.1.250.0070.00316.05
7.1.200.0040.00415.59
7.1.100.0070.01018.23
7.1.70.0000.00817.15
7.1.60.0180.00720.03
7.1.50.0110.01117.18
7.1.00.0030.07722.30
7.0.200.0040.00714.97
7.0.60.0130.06720.03
7.0.50.0100.06317.87
7.0.40.0100.08720.24
7.0.30.0530.07320.16
7.0.20.0270.05320.07
7.0.10.0100.04720.09
7.0.00.0100.07320.19
5.6.280.0030.03721.16
5.6.210.0070.06720.48
5.6.200.0100.08018.18
5.6.190.0030.08020.57
5.6.180.0230.04020.68
5.6.170.0130.07320.48
5.6.160.0170.03020.62
5.6.150.0070.05018.11
5.6.140.0070.08318.18
5.6.130.0030.07018.29
5.6.120.0130.07321.04
5.6.110.0100.09021.08
5.6.100.0000.09020.98
5.6.90.0100.07721.00
5.6.80.0100.06320.49
5.6.70.4430.03020.25
5.5.350.0370.07020.30
5.5.340.0000.04317.95
5.5.330.0070.05020.31
5.5.320.0370.07020.34
5.5.310.0200.06720.26
5.5.300.0000.04317.95
5.5.290.0100.05018.07
5.5.280.0070.03720.65
5.5.270.0030.09320.85
5.5.260.0100.06020.68
5.5.250.0030.08320.75
5.5.240.0230.07720.19
5.4.450.0700.06319.18
5.4.440.0670.06319.47
5.4.430.1000.07319.55
5.4.420.0800.05319.38
5.4.410.0830.06019.50
5.4.400.0600.06019.15
5.4.390.0630.06019.28
5.4.380.0830.05319.28
5.4.370.0700.06018.87
5.4.360.0770.05319.23
5.4.350.0770.05018.98
5.4.340.0630.06319.39
5.4.320.0770.05719.14
5.4.310.0770.04318.99
5.4.300.0670.04718.86
5.4.290.0700.05019.25
5.4.280.0700.04718.84
5.4.270.0570.05719.14
5.4.260.0900.05019.27
5.4.250.0770.05019.27
5.4.240.0800.07019.25
5.4.230.0700.05719.00
5.4.220.0270.06018.84
5.4.210.0100.05719.13
5.4.200.0030.08316.80
5.4.190.0830.04019.12
5.4.180.0700.05319.07
5.4.170.0700.05319.01
5.4.160.0800.06318.92
5.4.150.0900.05319.00
5.4.140.0800.05316.60
5.4.130.0870.04716.55
5.4.120.1000.04316.55
5.4.110.0800.05016.43
5.4.100.0730.05016.46
5.4.90.0870.06016.45
5.4.80.0700.05016.74
5.4.70.0670.06316.35
5.4.60.0100.04016.52
5.4.50.0000.07716.48
5.4.40.0170.03716.51
5.4.30.0300.06316.16
5.4.20.0230.06316.43

preferences:
53.52 ms | 400 KiB | 5 Q