3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function data($query) { $data = null; for ($i = 1; $i <= 1000; $i++) { $data = $this->format($this->search($this->factory(), $query)); } return $data; } protected function factory() { return array( 'hello world', 'test 123', 'laravel', 'php', 'twitter', 'liquid', 'twekkisd', 'tekkit', 'minecrtafspeltwrong', 'minecraft', 'java', 'hhvm', 'qwertuop', 'qwerty', 'abc', 'coffee', 'dsmg', 'admin@dsmg.co.uk', 'graham@dsmg.co.uk' ); } protected function search($data, $query) { foreach ($data as $key => $value) { if (strpos($value, $query) === false) { unset($data[$key]); } } return $data; } protected function format($data) { $new = array(); foreach($data as $value) { $tmp = new stdClass; $tmp->val = $value; $new[] = $tmp; } return $new; } } $test = new Test; $test->data('123');

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.0060.01318.43
8.3.50.0120.00721.09
8.3.40.0070.01118.86
8.3.30.0040.01119.21
8.3.20.0040.00420.29
8.3.10.0080.00021.91
8.3.00.0040.00422.43
8.2.180.0170.00016.38
8.2.170.0110.00822.96
8.2.160.0070.00720.39
8.2.150.0070.00424.18
8.2.140.0030.00624.66
8.2.130.0070.00726.16
8.2.120.0060.01119.66
8.2.110.0000.01122.08
8.2.100.0090.00317.84
8.2.90.0030.00618.03
8.2.80.0000.00917.97
8.2.70.0090.00017.75
8.2.60.0000.01017.93
8.2.50.0000.00918.07
8.2.40.0070.00318.34
8.2.30.0030.00618.17
8.2.20.0000.01017.68
8.2.10.0000.00917.67
8.2.00.0060.00317.77
8.1.280.0070.01525.92
8.1.270.0030.00620.43
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0080.00322.19
8.1.230.0060.00917.42
8.1.220.0000.00917.79
8.1.210.0030.00618.88
8.1.200.0040.00717.35
8.1.190.0030.00617.43
8.1.180.0000.01019.13
8.1.170.0050.00518.50
8.1.160.0030.00622.10
8.1.150.0040.00418.62
8.1.140.0090.00017.45
8.1.130.0000.00817.72
8.1.120.0040.00417.55
8.1.110.0000.00917.38
8.1.100.0000.01217.43
8.1.90.0000.00817.48
8.1.80.0030.00517.49
8.1.70.0040.00417.47
8.1.60.0110.00017.64
8.1.50.0030.00617.46
8.1.40.0030.00617.38
8.1.30.0030.00617.62
8.1.20.0030.00617.63
8.1.10.0000.00917.46
8.1.00.0030.00617.47
8.0.300.0060.00319.98
8.0.290.0030.00617.04
8.0.280.0060.00318.34
8.0.270.0030.00617.19
8.0.260.0000.00816.86
8.0.250.0000.00816.98
8.0.240.0070.00317.03
8.0.230.0000.00816.98
8.0.220.0050.00316.89
8.0.210.0050.00316.79
8.0.200.0000.00816.83
8.0.190.0060.00317.02
8.0.180.0060.00316.96
8.0.170.0000.00916.89
8.0.160.0030.00616.96
8.0.150.0030.00616.84
8.0.140.0040.00816.89
8.0.130.0030.00313.28
8.0.120.0040.00416.76
8.0.110.0050.00516.79
8.0.100.0060.00316.98
8.0.90.0060.00316.86
8.0.80.0120.01216.90
8.0.70.0030.00616.78
8.0.60.0000.00916.94
8.0.50.0000.00916.93
8.0.30.0060.01517.03
8.0.20.0100.01017.40
8.0.10.0000.00917.02
8.0.00.0110.01016.82
7.4.330.0000.00615.13
7.4.320.0040.00416.48
7.4.300.0020.00516.48
7.4.290.0030.00616.52
7.4.280.0000.00816.43
7.4.270.0000.00816.48
7.4.260.0040.00416.41
7.4.250.0000.00916.57
7.4.240.0030.00616.56
7.4.230.0000.00816.56
7.4.220.0070.01416.51
7.4.210.0080.01116.57
7.4.200.0030.00616.63
7.4.190.0060.00316.65
7.4.160.0110.00716.71
7.4.150.0100.01017.40
7.4.140.0120.01117.86
7.4.130.0090.01416.69
7.4.120.0150.00516.57
7.4.110.0160.00616.57
7.4.100.0140.00716.64
7.4.90.0160.01016.60
7.4.80.0100.01019.39
7.4.70.0150.00916.52
7.4.60.0040.01516.59
7.4.50.0000.00716.52
7.4.40.0080.01122.77
7.4.30.0040.01516.42
7.4.00.0070.01015.15
7.3.330.0030.00313.25
7.3.320.0070.00013.39
7.3.310.0040.00416.37
7.3.300.0040.00416.18
7.3.290.0000.01616.22
7.3.280.0090.00916.35
7.3.270.0140.01017.40
7.3.260.0090.01216.50
7.3.250.0130.00816.35
7.3.240.0070.02216.29
7.3.230.0120.01616.63
7.3.210.0030.01616.45
7.3.200.0100.00919.39
7.3.190.0190.00616.41
7.3.180.0040.01516.33
7.3.170.0070.01116.56
7.3.160.0120.00616.58
7.3.120.0030.01314.87
7.2.330.0030.01516.61
7.2.320.0070.01116.82
7.2.310.0090.00916.72
7.2.300.0130.01316.72
7.2.290.0130.00616.59
7.2.00.0030.01919.41
7.1.100.0000.01418.03
7.1.70.0000.00917.02
7.1.60.0140.01419.50
7.1.50.0000.01216.91
7.1.00.0100.05722.45
7.0.200.0070.01116.75
7.0.140.0030.07722.09
7.0.60.0200.04720.07
7.0.50.0070.08317.98
7.0.40.0000.06020.21
7.0.30.0330.08020.18
7.0.20.0200.04020.08
7.0.10.0130.07720.23
7.0.00.0030.09320.06
5.6.280.0030.08320.83
5.6.210.0200.08020.48
5.6.200.0130.05718.20
5.6.190.0130.09020.41
5.6.180.0470.07720.67
5.6.170.0370.08020.47
5.6.160.0030.04720.41
5.6.150.0100.07718.18
5.6.140.0100.08318.23
5.6.130.0030.07718.23
5.6.120.0030.05320.97
5.6.110.0100.08021.02
5.6.100.0170.08720.98
5.6.90.0070.09321.00
5.6.80.0070.04020.54
5.5.350.0300.08020.54
5.5.340.0070.05318.05
5.5.330.0100.04720.44
5.5.320.0370.05320.42
5.5.310.0230.05320.35
5.5.300.0070.04017.98
5.5.290.0030.07318.08
5.5.280.0070.09320.66
5.5.270.0070.08720.86
5.5.260.0070.08720.99
5.5.250.0100.09320.59
5.5.240.0030.09020.34
5.4.450.0500.07019.16
5.4.440.0800.06019.47
5.4.430.0170.06019.46
5.4.420.0100.06319.41
5.4.410.0100.07318.69
5.4.400.0130.05718.74
5.4.390.0070.07318.78
5.4.380.0070.06718.48
5.4.370.0100.06718.57
5.4.360.0230.05018.76
5.4.350.0070.04612.03
5.4.340.0070.04812.02
5.4.320.0040.04512.51
5.4.310.0070.04412.51
5.4.300.0070.04212.51
5.4.290.0070.05212.51
5.4.280.0060.05412.41
5.4.270.0050.04612.41
5.4.260.0050.05012.41
5.4.250.0070.06718.95
5.4.240.0100.06018.80
5.4.230.0030.06718.93
5.4.220.0100.06318.78
5.4.210.0170.06718.80
5.4.200.0030.06719.04
5.4.190.0070.06719.02
5.4.180.0030.06318.93
5.4.170.0030.06718.79
5.4.160.0130.08318.99
5.4.150.0030.09718.95
5.4.140.0100.06716.48
5.4.130.0130.08316.26
5.4.120.0070.08716.36
5.4.110.0000.09316.53
5.4.100.0130.08316.41
5.4.90.0230.06716.43
5.4.80.0030.05716.55
5.4.70.0000.06316.54
5.4.60.0100.05316.51
5.4.50.0100.05316.38
5.4.40.0070.05716.50
5.4.30.0070.05716.47
5.4.20.0200.05716.62
5.4.10.0130.06016.45
5.4.00.0070.05315.74
5.3.290.0070.04712.80
5.3.280.0070.06314.77
5.3.270.0100.06014.59
5.3.260.0070.06714.78
5.3.250.0100.06314.84
5.3.240.0100.07714.60
5.3.230.0130.07014.77
5.3.220.0100.07714.71
5.3.210.0230.07314.66
5.3.200.0100.09314.41
5.3.190.0100.06314.67
5.3.180.0070.06314.40
5.3.170.0030.06314.56
5.3.160.0100.06014.66
5.3.150.0070.06314.64
5.3.140.0030.07714.59
5.3.130.0130.05714.63
5.3.120.0130.05714.57
5.3.110.0070.06314.78
5.3.100.0100.05714.04
5.3.90.0130.05714.09
5.3.80.0030.06314.13
5.3.70.0030.06014.11
5.3.60.0100.06013.98
5.3.50.0100.06013.79
5.3.40.0030.06714.05
5.3.30.0130.04714.10
5.3.20.0030.06013.87
5.3.10.0170.06313.63
5.3.00.0130.05713.73
5.2.170.0030.05711.29
5.2.160.0070.05311.15
5.2.150.0130.04311.38
5.2.140.0100.04711.16
5.2.130.0070.05011.28
5.2.120.0070.04711.20
5.2.110.0070.04711.29
5.2.100.0000.05711.18
5.2.90.0030.05311.10
5.2.80.0070.05011.33
5.2.70.0170.05711.19
5.2.60.0030.05311.14
5.2.50.0170.04310.87
5.2.40.0030.05711.09
5.2.30.0030.05311.08
5.2.20.0100.04311.05
5.2.10.0030.05310.95
5.2.00.0100.06710.64
5.1.60.0100.04010.07
5.1.50.0100.04310.25
5.1.40.0030.04710.20
5.1.30.0000.05010.43
5.1.20.0000.05710.45
5.1.10.0070.04710.14
5.1.00.0070.04710.28
5.0.50.0000.0578.54
5.0.40.0030.0538.43
5.0.30.0030.0678.29
5.0.20.0070.0538.16
5.0.10.0000.0538.25
5.0.00.0070.0678.17
4.4.90.0030.0207.34
4.4.80.0000.0237.34
4.4.70.0000.0307.34
4.4.60.0100.0137.34
4.4.50.0070.0177.34
4.4.40.0000.0437.34
4.4.30.0030.0307.34
4.4.20.0030.0207.34
4.4.10.0100.0137.34
4.4.00.0030.0337.34
4.3.110.0000.0307.34
4.3.100.0000.0207.34
4.3.90.0000.0207.34
4.3.80.0000.0337.34
4.3.70.0070.0177.34
4.3.60.0070.0177.34
4.3.50.0100.0137.34
4.3.40.0070.0277.34
4.3.30.0000.0237.34
4.3.20.0000.0237.34
4.3.10.0000.0207.34
4.3.00.0030.0206.88

preferences:
36.56 ms | 401 KiB | 5 Q