3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(0 => 'blue pants', 1 => 'red pants', 2 => 'green pants', 3 => 'green pants', 4=> 'red t-shirt', 5=> 'blue redneck pants'); $return = preg_grep("/\bred\b/", $array); var_dump($return); /* array(2) { [1]=> string(9) "red pants" [4]=> string(11) "red t-shirt" } */

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.4.130.0040.00617.64
8.4.120.0120.01022.39
8.4.110.0110.00522.51
8.4.100.0100.01117.88
8.4.90.0120.00917.63
8.4.80.0050.00417.85
8.4.70.0150.00517.98
8.4.60.0110.01118.82
8.4.50.0130.00717.66
8.4.40.0140.00719.77
8.4.30.0130.00620.56
8.4.20.0110.00820.61
8.4.10.0100.01017.69
8.3.260.0110.01016.81
8.3.250.0150.00418.82
8.3.240.0120.00716.55
8.3.230.0130.00616.54
8.3.220.0040.00318.51
8.3.210.0050.00716.79
8.3.200.0050.00416.79
8.3.190.0120.00917.18
8.3.180.0140.00616.35
8.3.170.0110.00719.09
8.3.160.0110.00716.82
8.3.150.0030.00620.86
8.3.140.0160.00316.53
8.3.130.0090.00018.39
8.3.120.0000.00920.57
8.3.110.0110.00020.94
8.3.100.0110.00016.61
8.3.90.0050.00326.77
8.3.80.0060.00318.31
8.3.70.0160.00616.75
8.3.60.0140.00718.31
8.3.50.0120.00721.98
8.3.40.0110.01118.77
8.3.30.0110.00318.65
8.3.20.0030.00623.52
8.3.10.0050.00320.33
8.3.00.0000.00822.40
8.2.290.0040.00418.91
8.2.280.0050.00420.13
8.2.270.0110.00717.37
8.2.260.0110.00718.88
8.2.250.0080.00018.70
8.2.240.0090.00918.86
8.2.230.0060.00322.58
8.2.220.0100.01024.06
8.2.210.0090.00926.77
8.2.200.0040.00416.75
8.2.190.0090.00916.75
8.2.180.0140.00716.73
8.2.170.0090.00622.96
8.2.160.0030.01219.16
8.2.150.0060.00325.66
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00420.85
8.2.110.0000.00820.56
8.2.100.0080.00417.91
8.2.90.0000.00817.63
8.2.80.0030.00618.71
8.2.70.0000.00917.75
8.2.60.0080.00017.88
8.2.50.0040.00417.75
8.2.40.0000.00819.29
8.2.30.0000.00719.09
8.2.20.0030.00618.02
8.2.10.0040.00419.33
8.2.00.0040.00419.14
8.1.330.0140.00521.95
8.1.320.0120.00716.23
8.1.310.0000.00816.72
8.1.300.0000.00918.25
8.1.290.0060.00318.88
8.1.280.0100.01025.92
8.1.270.0030.00622.42
8.1.260.0090.00026.35
8.1.250.0030.00528.09
8.1.240.0070.00323.78
8.1.230.0040.00723.84
8.1.220.0060.00317.76
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00819.01
8.1.160.0000.00718.77
8.1.150.0000.00718.79
8.1.140.0000.00720.84
8.1.130.0000.00717.54
8.1.120.0000.00817.53
8.1.110.0040.00417.54
8.1.100.0000.00817.54
8.1.90.0000.00817.42
8.1.80.0000.00817.60
8.1.70.0030.00317.43
8.1.60.0040.00417.68
8.1.50.0040.00417.57
8.1.40.0060.00317.63
8.1.30.0050.00317.63
8.1.20.0030.00617.63
8.1.10.0060.00317.63
8.1.00.0000.00717.53
8.0.300.0000.00821.74
8.0.290.0050.00316.75
8.0.280.0040.00418.27
8.0.270.0000.00717.26
8.0.260.0070.00016.89
8.0.250.0070.00016.92
8.0.240.0040.00417.07
8.0.230.0030.00317.09
8.0.220.0000.00716.93
8.0.210.0000.00716.98
8.0.200.0030.00317.03
8.0.190.0030.00616.91
8.0.180.0000.00816.88
8.0.170.0060.00317.03
8.0.160.0070.00016.97
8.0.150.0050.00316.86
8.0.140.0000.00716.91
8.0.130.0030.00313.40
8.0.120.0040.00416.98
8.0.110.0000.00716.91
8.0.100.0040.00417.02
8.0.90.0040.00416.84
8.0.80.0030.01316.97
8.0.70.0040.00416.86
8.0.60.0040.00416.79
8.0.50.0080.00017.09
8.0.30.0030.01816.99
8.0.20.0140.00717.27
8.0.10.0050.00216.93
8.0.00.0140.00616.82
7.4.330.0000.00515.55
7.4.320.0070.00016.76
7.4.300.0040.00416.65
7.4.290.0040.00416.60
7.4.280.0000.00716.64
7.4.270.0070.00016.73
7.4.260.0070.00016.70
7.4.250.0050.00216.71
7.4.240.0020.00516.71
7.4.230.0040.00416.54
7.4.220.0050.00216.59
7.4.210.0150.00216.75
7.4.200.0030.00316.50
7.4.140.0150.00617.86
7.4.130.0070.01816.66
7.4.120.0100.01316.54
7.4.110.0130.00316.75
7.4.100.0100.01016.48
7.4.90.0070.01416.52
7.4.80.0070.01119.39
7.4.70.0120.00916.57
7.4.60.0080.00816.65
7.4.50.0070.01116.58
7.4.40.0100.00716.60
7.4.00.0060.01114.96
7.3.330.0040.00413.01
7.3.320.0060.00013.09
7.3.310.0040.00416.13
7.3.300.0040.00416.29
7.3.290.0000.00716.31
7.3.280.0090.00616.31
7.3.260.0100.00816.36
7.3.240.0070.01016.41
7.3.230.0110.00716.52
7.3.210.0000.01616.75
7.3.200.0160.00016.24
7.3.190.0100.00716.48
7.3.180.0180.00316.30
7.3.170.0070.01016.46
7.3.160.0050.01016.25
7.3.120.0100.00614.57
7.3.110.0080.00814.51
7.3.100.0060.00315.00
7.3.90.0000.00814.99
7.3.80.0030.01014.63
7.3.70.0070.00614.80
7.3.60.0080.00514.72
7.3.50.0050.00814.70
7.3.40.0110.00614.69
7.3.30.0050.01014.68
7.3.20.0040.00915.70
7.3.10.0100.00515.74
7.3.00.0100.00915.60
7.2.330.0040.01416.72
7.2.320.0100.01416.82
7.2.310.0100.00716.70
7.2.300.0070.01016.50
7.2.290.0030.01316.72
7.2.250.0030.01315.08
7.2.240.0070.01315.21
7.2.230.0080.00815.00
7.2.220.0070.01114.74
7.2.210.0080.00515.12
7.2.200.0100.00614.92
7.2.190.0070.00914.90
7.2.180.0020.01215.04
7.2.170.0060.01114.97
7.2.160.0110.00614.86
7.2.150.0100.01615.08
7.2.140.0170.00315.01
7.2.130.0120.00615.16
7.2.120.0130.00614.85
7.2.110.0110.01115.10
7.2.100.0100.01015.00
7.2.90.0100.00715.06
7.2.80.0100.00715.12
7.2.70.0030.01215.16
7.2.60.0140.00715.23
7.2.50.0120.00415.17
7.2.40.0150.00315.14
7.2.30.0120.00615.26
7.2.20.0140.00315.27
7.2.10.0120.00415.11
7.2.00.0090.00915.16
7.1.330.0100.00615.76
7.1.320.0070.00715.97
7.1.310.0000.01015.86
7.1.300.0390.00615.01
7.1.290.0070.01014.82
7.1.280.0080.01215.01
7.1.270.0060.01014.82
7.1.260.0060.01015.10
7.1.250.0130.00614.27

preferences:
147.91 ms | 403 KiB | 5 Q