3v4l.org

run code in 300+ PHP versions simultaneously
<?php $config = [ "testA" => true, "testB" => 22, 0 => 0 ]; class Processor { public $systemVarA; public $systemVarB; private function validators() { return [ 'testA' => function($value) { if (!is_bool($value)) throw new \Exception( "Configuration '$name' must be boolean."); $this->systemVarA = $value; }, 'testB' => function($value) { if (!is_int($value)) throw new \Exception( "Configuration '$name' must be integer."); $this->systemVarB = $value; } ]; } public function validate($array) { $validators = $this->validators(); foreach($array as $key => $value) if(is_callable($validators[$key])) $validators[$key]($value); } } $proc = new Processor; $proc->validate($config); var_dump($proc);

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.5.10.0110.00718.95
8.5.00.0110.01120.21
8.4.150.0020.00114.05
8.4.140.0110.01017.66
8.4.130.0140.00617.60
8.4.120.0050.00519.67
8.4.110.0140.00617.76
8.4.100.0090.01218.03
8.4.90.0050.00720.93
8.4.80.0020.00618.82
8.4.70.0120.00920.61
8.4.60.0100.01020.33
8.4.50.0090.01218.71
8.4.40.0100.01018.11
8.4.30.0110.00420.38
8.4.20.0100.01017.96
8.4.10.0080.00017.82
8.3.280.0130.00818.56
8.3.270.0090.01016.96
8.3.260.0140.00616.63
8.3.250.0110.00416.62
8.3.240.0150.00316.55
8.3.230.0130.00618.42
8.3.220.0040.00419.10
8.3.210.0060.01318.74
8.3.200.0070.00216.83
8.3.190.0080.00317.05
8.3.180.0140.00519.05
8.3.170.0160.00318.81
8.3.160.0090.00920.67
8.3.150.0030.00516.68
8.3.140.0040.00416.93
8.3.130.0050.00318.63
8.3.120.0070.01118.88
8.3.110.0050.00320.94
8.3.100.0040.00424.06
8.3.90.0050.00326.77
8.3.80.0070.00319.36
8.3.70.0000.01416.87
8.3.60.0040.01116.63
8.3.50.0130.00823.69
8.3.40.0130.00318.80
8.3.30.0150.00018.73
8.3.20.0000.00721.89
8.3.10.0080.00021.60
8.3.00.0040.00421.86
8.2.290.0130.00616.96
8.2.280.0050.00318.45
8.2.270.0040.01518.78
8.2.260.0040.00417.49
8.2.250.0150.00316.84
8.2.240.0050.00518.27
8.2.230.0050.00322.58
8.2.220.0060.00337.54
8.2.210.0070.00026.77
8.2.200.0090.00018.88
8.2.190.0030.01116.63
8.2.180.0100.00718.36
8.2.170.0040.01122.96
8.2.160.0140.00020.45
8.2.150.0070.00324.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0030.00620.94
8.2.110.0030.00622.21
8.2.100.0070.00717.71
8.2.90.0000.00817.88
8.2.80.0000.00918.86
8.2.70.0090.00017.75
8.2.60.0080.00019.60
8.2.50.0060.00317.63
8.2.40.0040.00419.47
8.2.30.0070.00019.46
8.2.20.0050.00218.02
8.2.10.0000.00719.33
8.2.00.0050.00219.41
8.1.330.0110.00816.42
8.1.320.0190.00416.26
8.1.310.0100.00718.51
8.1.300.0000.00918.38
8.1.290.0060.00330.84
8.1.280.0100.01025.92
8.1.270.0060.01322.00
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00620.20
8.1.230.0060.00617.79
8.1.220.0040.00417.76
8.1.210.0080.00018.77
8.1.200.0000.00817.13
8.1.190.0040.00417.22
8.1.180.0000.00919.13
8.1.170.0040.00418.80
8.1.160.0040.00418.98
8.1.150.0040.00418.86
8.1.140.0060.00320.66
8.1.130.0030.00320.29
8.1.120.0070.00017.51
8.1.110.0050.00217.48
8.1.100.0030.00317.37
8.1.90.0070.00017.46
8.1.80.0030.00417.48
8.1.70.0000.00717.39
8.1.60.0000.00817.59
8.1.50.0000.00817.55
8.1.40.0060.00317.52
8.1.30.0080.00017.50
8.1.20.0000.00817.69
8.1.10.0030.00617.43
8.1.00.0040.00417.51
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.49
8.0.270.0000.00718.01
8.0.260.0030.00320.14
8.0.250.0050.00216.95
8.0.240.0000.00717.05
8.0.230.0030.00316.91
8.0.220.0070.00016.92
8.0.210.0000.00716.89
8.0.200.0030.00317.03
8.0.190.0000.00716.99
8.0.180.0040.00417.00
8.0.170.0060.00616.99
8.0.160.0030.00616.95
8.0.150.0000.00716.87
8.0.140.0040.00416.90
8.0.130.0030.00313.36
8.0.120.0030.00516.91
8.0.110.0030.00517.04
8.0.100.0000.00716.80
8.0.90.0030.00616.95
8.0.80.0050.00917.00
8.0.70.0000.00716.90
8.0.60.0040.00416.79
8.0.50.0040.00416.85
8.0.30.0150.00717.18
8.0.20.0130.00617.11
8.0.10.0030.00516.96
8.0.00.0090.00916.75
7.4.330.0050.00016.78
7.4.320.0000.00616.52
7.4.300.0030.00616.47
7.4.290.0000.00716.61
7.4.280.0070.00016.61
7.4.270.0000.00816.46
7.4.260.0030.00313.29
7.4.250.0050.00216.45
7.4.240.0030.00516.52
7.4.230.0070.00016.52
7.4.220.0020.00516.64
7.4.210.0040.01116.61
7.4.200.0040.00416.62
7.4.140.0100.01417.86
7.4.130.0100.01116.57
7.4.120.0100.00716.57
7.4.110.0030.01516.62
7.4.100.0100.00716.59
7.4.90.0090.00916.61
7.4.80.0120.00619.39
7.4.70.0120.00616.62
7.4.60.0100.00516.62
7.4.50.0080.00416.45
7.4.40.0070.01416.74
7.4.20.0130.00316.36
7.4.10.0120.00316.47
7.4.00.0090.00616.43
7.3.330.0030.00316.38
7.3.320.0030.00313.15
7.3.310.0050.00316.47
7.3.300.0070.00016.25
7.3.290.0050.01216.37
7.3.280.0170.00016.38
7.3.260.0140.00716.55
7.3.240.0100.01116.46
7.3.230.0190.01016.64
7.3.210.0060.01916.43
7.3.200.0100.00616.32
7.3.190.0110.00616.62
7.3.180.0090.01216.49
7.3.170.0050.01616.45
7.3.160.0030.01516.51
7.3.130.0120.00316.45
7.3.120.0110.00516.27
7.3.110.0090.00616.31
7.3.100.0040.01116.39
7.3.90.0090.00616.30
7.3.80.0110.00516.27
7.3.70.0100.00516.44
7.3.60.0090.00616.36
7.3.50.0060.00916.18
7.3.40.0070.00716.26
7.3.30.0080.01016.41
7.3.20.0080.00916.57
7.3.10.0090.00916.38
7.3.00.0040.01216.35
7.2.330.0060.01216.70
7.2.320.0140.00616.62
7.2.310.0160.00816.62
7.2.300.0110.00816.74
7.2.290.0080.01116.69
7.2.260.0150.00016.76
7.2.250.0070.01016.51
7.2.240.0100.01016.57
7.2.230.0090.00616.63
7.2.220.0030.01216.75
7.2.210.0050.01116.64
7.2.200.0100.00616.53
7.2.190.0040.01216.73
7.2.180.0080.00816.67
7.2.170.0100.00716.77
7.2.160.0060.00916.62
7.2.150.0070.01016.73
7.2.140.0110.00616.64
7.2.130.0100.00616.81
7.2.120.0060.00916.68
7.2.110.0130.00316.69
7.2.100.0070.01116.73
7.2.90.0100.00716.59
7.2.80.0100.00616.70
7.2.70.0070.01016.75
7.2.60.0030.01316.80
7.2.50.0100.00616.78
7.2.40.0060.01016.73
7.2.30.0030.01316.58
7.2.20.0090.00916.68
7.2.10.0140.00316.76
7.2.00.0000.01716.55

preferences:
35.85 ms | 403 KiB | 5 Q