3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'hello world'; $cnt = count(array_filter(str_split($str), function ($v) { return ord($v) % 3 == 0; })); echo 'total count- '.$cnt . PHP_EOL; $cnt = array_reduce(str_split($str), function ($c, $v) { return $c + (ord($v) % 3 == 0 ? 1 : 0); }, 0); echo 'total count- '.$cnt . PHP_EOL;

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.0060.00916.50
8.3.60.0140.00018.31
8.3.50.0120.00418.16
8.3.40.0070.01118.61
8.3.30.0070.00718.76
8.3.20.0070.00020.81
8.3.10.0080.00023.48
8.3.00.0070.00020.67
8.2.190.0120.00316.58
8.2.180.0060.00916.38
8.2.170.0090.01219.01
8.2.160.0100.00322.96
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00218.03
8.2.120.0040.00426.35
8.2.110.0080.00020.27
8.2.100.0080.00418.22
8.2.90.0040.00418.16
8.2.80.0040.00418.03
8.2.70.0060.00317.80
8.2.60.0040.00417.94
8.2.50.0050.00318.10
8.2.40.0000.00819.47
8.2.30.0040.00420.63
8.2.20.0000.00817.96
8.2.10.0030.00619.23
8.2.00.0030.00317.99
8.1.280.0040.01425.92
8.1.270.0040.00422.06
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00617.13
8.1.230.0120.00019.08
8.1.220.0000.00817.77
8.1.210.0050.00318.77
8.1.200.0060.00617.35
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0090.00018.66
8.1.160.0050.00218.76
8.1.150.0040.00418.85
8.1.140.0000.00718.93
8.1.130.0000.00620.22
8.1.120.0070.00017.45
8.1.110.0050.00217.38
8.1.100.0040.00417.41
8.1.90.0090.00017.50
8.1.80.0000.00717.49
8.1.70.0030.00317.42
8.1.60.0060.00317.57
8.1.50.0040.00417.51
8.1.40.0050.00317.43
8.1.30.0040.00417.66
8.1.20.0040.00717.64
8.1.10.0080.00017.43
8.1.00.0000.00717.28
8.0.300.0060.00319.60
8.0.290.0000.00716.75
8.0.280.0030.00518.35
8.0.270.0000.00717.89
8.0.260.0030.00318.52
8.0.250.0070.00016.96
8.0.240.0040.00416.96
8.0.230.0000.00716.85
8.0.220.0000.00716.90
8.0.210.0040.00416.83
8.0.200.0030.00316.92
8.0.190.0000.00816.97
8.0.180.0000.00816.87
8.0.170.0040.00416.93
8.0.160.0070.00016.95
8.0.150.0000.00816.80
8.0.140.0000.00716.81
8.0.130.0050.00013.40
8.0.120.0050.00316.75
8.0.110.0020.00516.80
8.0.100.0000.00716.76
8.0.90.0000.00716.76
8.0.80.0110.00716.86
8.0.70.0030.00516.89
8.0.60.0040.00417.00
8.0.50.0000.00716.79
8.0.30.0120.00717.02
8.0.20.0160.00317.07
8.0.10.0000.00717.01
8.0.00.0090.01016.77
7.4.330.0050.00016.79
7.4.320.0030.00316.45
7.4.300.0030.00316.62
7.4.290.0040.00416.49
7.4.280.0040.00416.49
7.4.270.0030.00316.55
7.4.260.0000.00716.57
7.4.250.0030.00316.37
7.4.240.0030.00316.51
7.4.230.0000.00716.63
7.4.220.0040.00416.45
7.4.210.0110.00616.51
7.4.200.0070.00016.45
7.4.160.0080.00816.40
7.4.140.0090.00917.86
7.4.130.0130.00316.50
7.4.120.0130.01016.51
7.4.110.0120.00316.31
7.4.100.0080.00816.42
7.4.90.0070.01016.39
7.4.80.0120.00619.39
7.4.70.0090.00916.46
7.4.60.0060.00916.54
7.4.50.0120.00316.40
7.4.40.0070.01016.44
7.4.00.0040.01115.07
7.3.330.0030.00313.29
7.3.320.0050.00013.16
7.3.310.0000.00716.27
7.3.300.0070.00016.23
7.3.290.0200.00316.20
7.3.280.0080.00816.25
7.3.260.0090.01016.43
7.3.240.0090.00816.50
7.3.230.0090.00916.53
7.3.210.0090.00616.28
7.3.200.0100.00816.43
7.3.190.0120.00316.47
7.3.180.0040.01816.42
7.3.170.0100.01116.70
7.3.160.0080.00816.30
7.3.40.0090.01214.55
7.3.30.0080.00314.55
7.3.20.0120.00016.49
7.3.10.0040.01116.62
7.3.00.0110.00016.50
7.2.330.0060.01216.42
7.2.320.0060.01016.43
7.2.310.0090.01016.79
7.2.300.0120.00816.89
7.2.290.0170.00616.57
7.2.170.0070.00415.00
7.2.160.0040.00715.05
7.2.150.0060.00616.89
7.2.140.0030.02016.52
7.2.130.0090.00416.83
7.2.120.0040.00716.67
7.2.110.0000.01616.88
7.2.100.0040.00816.96
7.2.90.0150.00617.05
7.2.80.0090.00616.79
7.2.70.0000.01116.72
7.2.60.0080.00316.84
7.2.50.0100.00316.77
7.2.40.0060.00616.97
7.2.30.0070.01016.73
7.2.20.0060.00916.75
7.2.10.0090.00616.88
7.2.00.0000.01517.00
7.1.280.0040.00815.44
7.1.270.0030.01115.86
7.1.260.0100.00315.63
7.1.250.0000.01015.49

preferences:
17.55 ms | 401 KiB | 5 Q