3v4l.org

run code in 300+ PHP versions simultaneously
<?php $results = array( 0 => 'DogCatSheepBlue WhaleShark', 1 => 'CatPigGoatOtter', 2 => 'ElephantTigerDogBlue WhaleGoat', 3 => 'SeahorseSnakeGoatLion' ); function search($array, $search) { $words = explode(' ', $search); $regex = '/(' . implode('|', array_filter($words)) . ')/'; return array_filter($array, function ($v) use ($regex) { return preg_match($regex, $v); }); } print_r(search($results, 'Cat Whale')); print_r(search($results, 'GoatSeahorse')); print_r(search($results, 'Pig'));

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.140.0180.00617.84
8.4.130.0140.00518.52
8.4.120.0060.00424.04
8.4.110.0100.00919.00
8.4.100.0190.00318.07
8.4.90.0070.00420.64
8.4.80.0040.00519.11
8.4.70.0120.00717.75
8.4.60.0090.00218.84
8.4.50.0100.00117.96
8.4.40.0110.00820.48
8.4.30.0100.01018.51
8.4.20.0100.00719.62
8.4.10.0090.00922.67
8.3.270.0110.00816.77
8.3.260.0080.01216.97
8.3.250.0090.00719.02
8.3.240.0080.01316.61
8.3.230.0060.00416.55
8.3.220.0090.00818.73
8.3.210.0070.00716.62
8.3.200.0050.00416.59
8.3.190.0100.00917.07
8.3.180.0050.00416.82
8.3.170.0040.00417.21
8.3.160.0100.01018.66
8.3.150.0090.01218.98
8.3.140.0130.00616.56
8.3.130.0100.00718.65
8.3.120.0000.00918.92
8.3.110.0130.00620.94
8.3.100.0030.01224.06
8.3.90.0040.00426.77
8.3.80.0030.00619.36
8.3.70.0190.00316.75
8.3.60.0040.01116.49
8.3.50.0100.00723.79
8.3.40.0120.00918.84
8.3.30.0090.00619.08
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0070.00026.16
8.2.290.0090.01016.70
8.2.280.0050.00318.41
8.2.270.0160.00316.89
8.2.260.0180.00016.64
8.2.250.0120.00316.68
8.2.240.0030.00617.22
8.2.230.0060.00322.58
8.2.220.0100.00737.54
8.2.210.0050.00226.77
8.2.200.0030.00618.88
8.2.190.0140.00718.38
8.2.180.0040.01125.92
8.2.170.0110.00722.96
8.2.160.0000.01322.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0070.00021.20
8.2.110.0070.00322.20
8.2.100.0090.00318.03
8.2.90.0000.00817.75
8.2.80.0000.00819.05
8.2.70.0000.00817.88
8.2.60.0050.00317.92
8.2.50.0000.00818.07
8.2.40.0080.00018.16
8.2.30.0080.00018.03
8.2.20.0000.00718.03
8.2.10.0030.00619.41
8.2.00.0000.00719.26
8.1.330.0110.00816.38
8.1.320.0150.00716.21
8.1.310.0120.00318.17
8.1.300.0090.00018.48
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0080.00023.99
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0030.00718.93
8.1.230.0080.00317.83
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00917.47
8.1.190.0080.00017.47
8.1.180.0060.00318.10
8.1.170.0060.00318.66
8.1.160.0040.00418.96
8.1.150.0000.00718.80
8.1.140.0070.00019.02
8.1.130.0030.00620.09
8.1.120.0050.00217.52
8.1.110.0080.00017.50
8.1.100.0040.00417.60
8.1.90.0040.00417.61
8.1.80.0040.00417.51
8.1.70.0000.00717.66
8.1.60.0060.00617.73
8.1.50.0000.00817.68
8.1.40.0000.00817.70
8.1.30.0040.00417.76
8.1.20.0080.00017.74
8.1.10.0050.00317.72
8.1.00.0080.00317.49
8.0.300.0050.00318.77
8.0.290.0030.00516.88
8.0.280.0030.00318.46
8.0.270.0000.00718.09
8.0.260.0090.00020.31
8.0.250.0000.00717.09
8.0.240.0030.00616.96
8.0.230.0030.00317.00
8.0.220.0000.00717.05
8.0.210.0000.00717.08
8.0.200.0030.00317.11
8.0.190.0040.00417.03
8.0.180.0000.00816.99
8.0.170.0040.00416.95
8.0.160.0000.00717.03
8.0.150.0000.00816.80
8.0.140.0040.00416.98
8.0.130.0050.00013.39
8.0.120.0000.00817.01
8.0.110.0030.00416.89
8.0.100.0050.00217.15
8.0.90.0030.00617.04
8.0.80.0080.00916.96
8.0.70.0000.00717.10
8.0.60.0050.00216.94
8.0.50.0040.00416.98
8.0.30.0090.00617.46
8.0.20.0110.00917.46
8.0.10.0000.00717.02
8.0.00.0130.01016.95
7.4.330.0040.00015.55
7.4.320.0030.00316.63
7.4.300.0050.00316.85
7.4.290.0030.00316.69
7.4.280.0000.00716.60
7.4.270.0040.00416.80
7.4.260.0050.00013.47
7.4.250.0040.00416.82
7.4.240.0020.00516.69
7.4.230.0000.00816.79
7.4.220.0080.00016.74
7.4.210.0060.00916.81
7.4.200.0080.00016.64
7.4.130.0100.00716.60
7.4.120.0140.00316.66
7.4.110.0080.01016.61
7.4.100.0140.00916.76
7.4.90.0100.00716.79
7.4.80.0110.00719.39
7.4.70.0140.01016.63
7.4.60.0170.00016.61
7.4.50.0090.00816.71
7.4.40.0100.01316.55
7.4.30.0190.00016.63
7.4.20.0150.00816.50
7.4.10.0090.00916.74
7.4.00.0130.00516.83
7.3.330.0080.00016.47
7.3.320.0000.00613.41
7.3.310.0060.00316.56
7.3.300.0030.00316.32
7.3.290.0030.01316.43
7.3.280.0100.00516.40
7.3.260.0100.00716.67
7.3.230.0100.00716.80
7.3.210.0150.00416.71
7.3.200.0110.00616.61
7.3.190.0130.00316.78
7.3.180.0160.02316.51
7.3.170.0070.01116.57
7.3.160.0130.01316.67
7.3.150.0100.00716.65
7.3.140.0060.01316.60
7.3.130.0160.00616.54
7.3.120.0060.01116.61
7.3.110.0080.00816.80
7.3.100.0090.00616.42
7.3.90.0190.00016.64
7.3.80.0110.00816.55
7.3.70.0080.00916.52
7.3.60.0100.00816.49
7.3.50.0120.01016.48
7.3.40.0110.00816.64
7.3.30.0100.01616.48
7.3.20.0060.01116.60
7.3.10.0070.01416.42
7.3.00.0120.00816.48
7.2.330.0070.01116.74
7.2.320.0030.01316.83
7.2.310.0110.01116.70
7.2.300.0100.00616.85
7.2.290.0070.01116.72
7.2.280.0100.00716.73
7.2.270.0090.00916.73
7.2.260.0130.01016.82
7.2.250.0070.01016.84
7.2.240.0070.01016.68
7.2.230.0140.00316.74
7.2.220.0060.01216.67
7.2.210.0130.00516.62
7.2.200.0100.00716.71
7.2.190.0060.01216.82
7.2.180.0030.02016.68
7.2.170.0040.01616.75
7.2.160.0150.00316.89
7.2.150.0110.00816.71
7.2.140.0130.00716.79
7.2.130.0120.00616.75
7.2.120.0060.01216.66
7.2.110.0040.01416.88
7.2.100.0140.00316.79
7.2.90.0070.01716.69
7.2.80.0120.01316.86
7.2.70.0090.01616.73
7.2.60.0110.01416.75
7.2.50.0130.00316.69
7.2.40.0160.00916.75
7.2.30.0380.00716.84
7.2.20.0100.01316.61
7.2.10.0160.00616.85
7.2.00.0150.00316.78

preferences:
30.9 ms | 403 KiB | 5 Q