3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sentence = 'My New Scooter is very Good'; $array = [ "Good Scooter", "lovely very Good Scooter", "Scooter is very Good and New", "Scooter is very Good and its My New Scooter" ]; $words = explode(' ', $sentence); $winner = ['index' => false, 'count' => 0 ]; foreach ($array as $k => $v) { $common = array_intersect($words, explode(' ', $v)); if ( $winner['count'] < count($common) ) $winner = ['index' => $k, 'count' => count($common)]; if ( $winner['count'] === count($words) ) break; } var_dump($winner);

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.5.10.0050.00316.71
8.5.00.0120.00920.18
8.4.150.0030.00014.05
8.4.140.0100.01217.70
8.4.130.0120.00820.40
8.4.120.0130.00622.44
8.4.110.0050.00618.75
8.4.100.0040.00518.64
8.4.90.0060.00520.81
8.4.80.0110.00720.62
8.4.70.0060.00218.16
8.4.60.0140.00619.00
8.4.50.0120.00918.78
8.4.40.0170.00319.33
8.4.30.0070.01320.35
8.4.20.0130.00718.66
8.4.10.0060.00317.87
8.3.280.0110.01018.36
8.3.270.0110.00816.64
8.3.260.0080.00516.79
8.3.250.0120.00719.07
8.3.240.0130.00716.84
8.3.230.0080.01116.68
8.3.220.0060.00319.07
8.3.210.0090.01016.46
8.3.200.0050.00316.78
8.3.190.0140.00517.28
8.3.180.0150.00316.73
8.3.170.0100.00720.59
8.3.160.0150.00317.19
8.3.150.0140.00417.18
8.3.140.0120.00616.62
8.3.130.0090.00918.24
8.3.120.0130.00319.14
8.3.110.0150.00020.94
8.3.100.0030.00624.06
8.3.90.0070.00426.77
8.3.80.0060.00319.36
8.3.70.0110.00718.68
8.3.60.0110.01118.31
8.3.50.0100.01016.59
8.3.40.0060.00918.69
8.3.30.0070.00718.81
8.3.20.0000.00824.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0060.00220.19
8.2.280.0140.00619.87
8.2.270.0120.00617.36
8.2.260.0080.00316.47
8.2.250.0080.00016.69
8.2.240.0080.00818.41
8.2.230.0060.00322.58
8.2.220.0090.00637.54
8.2.210.0080.00026.77
8.2.200.0030.00618.88
8.2.190.0140.00316.58
8.2.180.0090.00925.92
8.2.170.0170.00319.09
8.2.160.0080.00822.96
8.2.150.0000.00725.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0100.01022.21
8.2.100.0120.00017.91
8.2.90.0040.00417.78
8.2.80.0040.00419.15
8.2.70.0050.00317.63
8.2.60.0080.00018.03
8.2.50.0090.00018.05
8.2.40.0050.00318.22
8.2.30.0000.00718.01
8.2.20.0080.00018.00
8.2.10.0040.00419.22
8.2.00.0080.00019.25
8.1.330.0060.00321.92
8.1.320.0150.00416.11
8.1.310.0030.00516.71
8.1.300.0110.00719.53
8.1.290.0030.00630.84
8.1.280.0070.00725.92
8.1.270.0000.00723.99
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0060.00322.53
8.1.230.0000.01121.04
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0000.00817.35
8.1.190.0060.00317.00
8.1.180.0040.00418.10
8.1.170.0000.00818.46
8.1.160.0040.00420.84
8.1.150.0040.00418.95
8.1.140.0040.00418.90
8.1.130.0000.00720.14
8.1.120.0100.00017.36
8.1.110.0030.00317.36
8.1.100.0050.00217.48
8.1.90.0000.00717.35
8.1.80.0030.00717.44
8.1.70.0090.00017.52
8.1.60.0040.00417.61
8.1.50.0030.00517.41
8.1.40.0070.00017.56
8.1.30.0050.00317.59
8.1.20.0000.00817.61
8.1.10.0040.00417.54
8.1.00.0070.00417.50
8.0.300.0040.00420.16
8.0.290.0000.00916.75
8.0.280.0000.00718.30
8.0.270.0070.00017.98
8.0.260.0030.00318.41
8.0.250.0080.00016.95
8.0.240.0000.00617.02
8.0.230.0000.00616.95
8.0.220.0030.00316.86
8.0.210.0000.00716.89
8.0.200.0070.00016.88
8.0.190.0040.00416.84
8.0.180.0000.00816.93
8.0.170.0050.00316.93
8.0.160.0050.00317.00
8.0.150.0000.00716.89
8.0.140.0070.00316.79
8.0.130.0030.00313.32
8.0.120.0060.00316.87
8.0.110.0040.00416.93
8.0.100.0000.00816.90
8.0.90.0040.00416.77
8.0.80.0090.00616.89
8.0.70.0070.00016.95
8.0.60.0040.00416.95
8.0.50.0000.00816.68
8.0.30.0100.00916.89
8.0.20.0170.01416.92
8.0.10.0220.00916.99
8.0.00.0270.00917.06
7.4.330.0020.00215.55
7.4.320.0030.00316.57
7.4.300.0040.00416.41
7.4.290.0040.00416.34
7.4.280.0040.00416.54
7.4.270.0040.00416.50
7.4.260.0000.00513.30
7.4.250.0060.00316.58
7.4.240.0050.00216.50
7.4.230.0000.00716.72
7.4.220.0020.00516.46
7.4.210.0120.00516.62
7.4.200.0040.00416.41
7.4.160.0210.01216.56
7.4.150.0220.00916.54
7.4.140.0190.01016.39
7.4.130.0300.00616.50
7.4.120.0270.00616.51
7.4.110.0180.01516.54
7.4.100.0300.00916.63
7.4.90.0250.00916.36
7.4.80.0200.01016.58
7.4.70.0160.00716.46
7.4.60.0080.01916.45
7.4.50.0140.01116.35
7.4.40.0110.01616.29
7.4.30.0090.01316.57
7.4.20.0110.00816.56
7.4.10.0160.01116.44
7.4.00.0100.01016.58
7.3.330.0070.00016.11
7.3.320.0060.00013.17
7.3.310.0030.00316.29
7.3.300.0040.00416.33
7.3.290.0110.00616.33
7.3.270.0240.00616.43
7.3.260.0240.00516.37
7.3.250.0190.00816.34
7.3.240.0170.01316.43
7.3.230.0230.01216.36
7.3.220.0340.00716.31
7.3.210.0240.01016.36
7.3.200.0200.01216.24
7.3.190.0110.01116.32
7.3.180.0090.01216.26
7.3.170.0150.00816.23
7.3.160.0170.00916.32
7.3.150.0090.01216.30
7.3.140.0100.01316.21
7.3.130.0160.00716.29
7.3.120.0220.00416.18
7.3.110.0140.01016.23
7.3.100.0160.01116.19
7.3.90.0120.00616.61
7.3.80.0150.00416.27
7.3.70.0140.00916.37
7.3.60.0100.01516.48
7.3.50.0140.00916.43
7.3.40.0050.01516.39
7.3.30.0200.00816.38
7.3.20.0120.01216.51
7.3.10.0260.00816.48
7.3.00.0190.01316.47

preferences:
35.29 ms | 403 KiB | 5 Q