3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array('potato', 'salad', 'salad_rel'); $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ substr($string, -4) == '_rel'; } } $end_time = microtime(TRUE); echo $end_time - $start_time; $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ preg_match('#.{1,}_rel$#', $string); } } $end_time = microtime(TRUE); echo $end_time - $start_time;

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)
7.4.10.0070.02015.01
7.4.00.0070.01814.90
7.3.130.0070.01314.60
7.3.120.0050.01714.93
7.3.110.0070.01715.08
7.3.100.0050.01215.09
7.3.90.0070.01214.89
7.3.80.0020.01814.88
7.3.70.0110.00914.98
7.3.60.0130.00715.01
7.3.50.0050.01314.89
7.3.40.0030.01714.96
7.3.30.0100.01214.92
7.3.20.0070.01516.69
7.3.10.0040.01616.69
7.3.00.0080.01316.73
7.2.260.0090.02115.20
7.2.250.0070.02415.34
7.2.240.0080.01415.25
7.2.230.0020.02015.29
7.2.220.0050.01915.17
7.2.210.0070.01615.31
7.2.200.0080.01615.09
7.2.190.0070.01615.19
7.2.180.0070.01514.95
7.2.170.0060.01715.19
7.2.160.0070.01715.24
7.2.150.0070.01717.11
7.2.140.0050.01817.02
7.2.130.0110.01116.78
7.2.120.0050.01716.96
7.2.110.0030.01916.91
7.2.100.0060.01316.97
7.2.90.0080.01217.09
7.2.80.0040.01917.00
7.2.70.0050.01816.99
7.2.60.0080.01317.16
7.2.50.0030.01916.95
7.2.40.0090.01416.90
7.2.30.0050.01616.96
7.2.20.0030.01717.00
7.2.10.0070.01916.94
7.2.00.0050.01517.94
7.1.330.0030.02215.89
7.1.320.0070.02115.71
7.1.310.0020.02216.06
7.1.300.0060.01915.78
7.1.290.0080.01815.77
7.1.280.0110.01615.83
7.1.270.0110.01615.98
7.1.260.0080.01916.09
7.1.250.0050.02115.76
7.1.240.0060.01615.95
7.1.230.0000.02515.80
7.1.220.0100.01316.08
7.1.210.0030.02016.05
7.1.200.0000.02615.91
7.1.190.0000.01916.05
7.1.180.0070.01615.86
7.1.170.0070.02015.92
7.1.160.0060.01616.12
7.1.150.0030.02216.02
7.1.140.0000.02716.01
7.1.130.0120.01516.04
7.1.120.0070.01615.89
7.1.110.0000.02615.93
7.1.100.0100.01616.05
7.1.90.0030.02515.95
7.1.80.0000.02216.04
7.1.70.0000.01916.45
7.1.60.0040.02517.46
7.1.50.0110.01916.56
7.1.40.0060.02615.98
7.1.30.0040.02215.89
7.1.20.0070.02115.70
7.1.10.0040.02215.85
7.1.00.0080.04819.32
7.0.330.0000.02515.43
7.0.320.0070.02115.30
7.0.310.0070.02115.25
7.0.300.0040.02115.36
7.0.290.0090.01515.52
7.0.280.0100.01715.66
7.0.270.0090.02215.59
7.0.260.0060.01615.66
7.0.250.0060.01615.51
7.0.240.0030.02215.60
7.0.230.0070.02315.31
7.0.220.0030.02315.68
7.0.210.0040.02315.29
7.0.200.0340.01915.33
7.0.190.0030.02415.56
7.0.180.0100.01715.48
7.0.170.0100.01615.50
7.0.160.0060.01615.52
7.0.150.0160.01015.71
7.0.140.0030.05118.76
7.0.130.0060.01815.66
7.0.120.0000.02215.67
7.0.110.0050.03117.64
7.0.100.0050.03817.89
7.0.90.0070.02917.78
7.0.80.0050.03317.60
7.0.70.0220.03617.77
7.0.60.0270.03317.76
7.0.50.0270.05517.77
7.0.40.0050.03516.67
7.0.30.0170.04316.77
7.0.20.0080.04316.70
7.0.10.0080.03516.75
7.0.00.0070.03516.58
5.6.400.0030.04814.13
5.6.390.0100.04114.72
5.6.380.0030.04614.58
5.6.370.0070.04514.80
5.6.360.0030.04314.62
5.6.350.0070.04314.16
5.6.340.0030.04414.14
5.6.330.0070.04114.42
5.6.320.0030.05314.30
5.6.310.0070.03914.67
5.6.300.0070.04414.50
5.6.290.0030.04014.71
5.6.280.0020.07517.89
5.6.270.0000.04814.36
5.6.260.0030.04717.55
5.6.250.0070.04717.43
5.6.240.0100.04217.52
5.6.230.0080.05917.48
5.6.220.0100.05317.52
5.6.210.0020.07217.33
5.6.200.0070.07417.39
5.6.190.0070.07117.56
5.6.180.0070.07017.41
5.6.170.0020.07017.49
5.6.160.0050.05117.45
5.6.150.0050.06417.59
5.6.140.0150.04017.53
5.6.130.0080.07017.63
5.6.120.0050.07217.35
5.6.110.0050.06217.44
5.6.100.0050.07117.41
5.6.90.0080.08017.50
5.6.80.0030.07617.19
5.6.70.0050.06917.06
5.6.60.0030.04817.19
5.6.50.0070.06417.23
5.6.40.0050.07517.23
5.6.30.0030.07117.09
5.6.20.0050.07316.95
5.6.10.0100.05617.19
5.6.00.0020.07817.16
5.5.380.0030.05115.98
5.5.370.0130.04815.96
5.5.360.0030.05715.84
5.5.350.0080.04715.80
5.5.340.0080.04716.19
5.5.330.0100.07016.24
5.5.320.0070.06616.09
5.5.310.0050.06816.03
5.5.300.0070.06015.99
5.5.290.0070.06815.97
5.5.280.0080.07216.31
5.5.270.0030.07816.19
5.5.260.0080.06616.13
5.5.250.0120.05816.05
5.5.240.0070.06415.99
5.5.230.0050.06315.86
5.5.220.0070.05615.81
5.5.210.0030.06015.76
5.5.200.0030.08015.88
5.5.190.0030.06615.92
5.5.180.0080.06815.80
5.5.170.0130.03514.44
5.5.160.0080.05015.87
5.5.150.0070.04015.58
5.5.140.0050.04315.65
5.5.130.0050.05015.83
5.5.120.0050.07415.75
5.5.110.0050.07015.88
5.5.100.0050.06215.56
5.5.90.0100.07015.80
5.5.80.0020.05215.69
5.5.70.0080.06015.61
5.5.60.0050.05015.87
5.5.50.0050.04815.74
5.5.40.0030.06815.51
5.5.30.0070.07115.60
5.5.20.0170.05315.89
5.5.10.0030.07115.66
5.5.00.0080.07015.93
5.4.450.0080.04315.20
5.4.440.0080.07415.23
5.4.430.0050.07215.33
5.4.420.0070.06715.18
5.4.410.0030.05615.11
5.4.400.0050.07014.93
5.4.390.0050.07115.11
5.4.380.0050.07014.92
5.4.370.0050.07415.22
5.4.360.0080.06815.03
5.4.350.0050.05415.03
5.4.340.0080.04714.92
5.4.330.0030.04411.02
5.4.320.0030.05415.21
5.4.310.0020.04615.05
5.4.300.0080.04614.97
5.4.290.0100.04615.01
5.4.280.0050.04515.05
5.4.270.0060.04115.12
5.4.260.0020.06615.11
5.4.250.0050.07115.04
5.4.240.0030.05615.13
5.4.230.0000.04415.08
5.4.220.0020.05615.05
5.4.210.0030.07314.96
5.4.200.0020.07215.03
5.4.190.0100.07114.97
5.4.180.0050.07015.15
5.4.170.0020.07515.04
5.4.160.0030.07015.19
5.4.150.0030.06014.92
5.4.140.0080.04613.81
5.4.130.0100.05713.80
5.4.120.0050.07013.70
5.4.110.0050.07213.63
5.4.100.0070.06613.67
5.4.90.0070.07013.68
5.4.80.0070.04513.83
5.4.70.0030.05013.71
5.4.60.0020.05113.59
5.4.50.0060.06013.60
5.4.40.0030.04513.63
5.4.30.0030.07013.71
5.4.20.0080.05813.69
5.4.10.0070.05813.69
5.4.00.0070.07313.48
5.3.290.0030.08014.46
5.3.280.0000.05314.46
5.3.270.0130.08314.64
5.3.260.0070.06014.43
5.3.250.0070.10314.48
5.3.240.0100.09714.47
5.3.230.0070.09714.49
5.3.220.0100.09014.67
5.3.210.0100.10014.50
5.3.200.0030.07714.45
5.3.190.0100.09314.50
5.3.180.0070.08014.46
5.3.170.0070.09714.42
5.3.160.0130.07014.46
5.3.150.0000.09014.58
5.3.140.0070.09314.58
5.3.130.0000.10314.62
5.3.120.0030.08314.33
5.3.110.0270.08714.54
5.3.100.0100.10313.90
5.3.90.0170.09713.96
5.3.80.0100.10313.91
5.3.70.0030.11314.02
5.3.60.0030.10713.93
5.3.50.0030.10013.79
5.3.40.0030.10013.83
5.3.30.0130.08013.73
5.3.20.0070.08713.71
5.3.10.0130.09013.66
5.3.00.0030.07313.70
5.2.170.0070.09312.13
5.2.160.0070.09312.13
5.2.150.0070.11312.13
5.2.140.0130.04712.13
5.2.130.0130.04312.13
5.2.120.0070.09012.13
5.2.110.0100.09712.13
5.2.100.0030.08712.13
5.2.90.0100.09012.13
5.2.80.0100.08712.13
5.2.70.0070.09012.13
5.2.60.0070.08712.13
5.2.50.0030.04712.13
5.2.40.0100.08312.13
5.2.30.0070.08712.13
5.2.20.0070.05012.13
5.2.10.0000.08312.13
5.2.00.0070.04312.13
5.1.60.0030.04012.13
5.1.50.0070.05312.13
5.1.40.0030.07012.13
5.1.30.0000.04012.13
5.1.20.0100.09312.13
5.1.10.0000.05012.13
5.1.00.0070.08312.13
5.0.50.0000.06312.13
5.0.40.0030.09312.13
5.0.30.0000.11012.13
5.0.20.0030.08712.13
5.0.10.0030.08012.13
5.0.00.0030.10312.13
4.4.90.0030.08012.13
4.4.80.0000.07012.13
4.4.70.0000.08012.13
4.4.60.0000.07312.13
4.4.50.0000.07312.13
4.4.40.0000.07012.13
4.4.30.0030.06312.13
4.4.20.0030.07312.13
4.4.10.0000.06712.13
4.4.00.0030.04312.13
4.3.110.0100.07012.13
4.3.100.0000.03712.13
4.3.90.0030.07712.13
4.3.80.0030.09712.13
4.3.70.0000.06712.13
4.3.60.0030.08012.13
4.3.50.0070.08312.13
4.3.40.0030.09312.13
4.3.30.0000.08712.13
4.3.20.0070.08012.13
4.3.10.0000.06312.13
4.3.00.0100.07712.13

preferences:
34.28 ms | 400 KiB | 5 Q