3v4l.org

run code in 300+ PHP versions simultaneously
<?php $word1 = 'abcdefghijkl'; $word2 = 'acgikluuo'; $expected = 6; function countMatchingChars($word1, $word2) { $matching = 0; foreach(str_split($word1) as $char) { if(strpos($word2, $char) !== false) { $matching++; } } return $matching; } $matchingChars = countMatchingChars($word1, $word2); assert($matchingChars === $expected);

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.0110.00616.52
8.5.00.0120.01020.00
8.4.150.0030.00014.05
8.4.140.0100.01117.64
8.4.130.0040.00518.87
8.4.120.0090.00224.18
8.4.110.0110.00918.63
8.4.100.0110.01017.74
8.4.90.0070.00318.58
8.4.80.0130.00717.79
8.4.70.0050.00317.69
8.4.60.0140.00718.41
8.4.50.0110.00918.57
8.4.40.0170.00319.75
8.4.30.0100.01018.52
8.4.20.0100.01020.07
8.4.10.0130.00317.69
8.3.280.0120.00918.50
8.3.270.0110.00816.49
8.3.260.0060.00516.23
8.3.250.0120.00618.87
8.3.240.0100.00917.16
8.3.230.0110.00816.48
8.3.220.0110.00716.99
8.3.210.0090.00916.80
8.3.200.0040.00516.79
8.3.190.0120.00716.49
8.3.180.0130.00616.54
8.3.170.0050.00320.84
8.3.160.0080.00517.34
8.3.150.0070.01016.97
8.3.140.0040.00416.52
8.3.130.0080.00018.59
8.3.120.0000.00919.00
8.3.110.0040.00416.78
8.3.100.0070.00316.50
8.3.90.0120.00316.29
8.3.80.0060.00317.97
8.3.70.0140.00316.50
8.3.60.0090.00618.33
8.3.50.0080.00618.24
8.3.40.0030.01318.61
8.3.30.0140.00718.55
8.3.20.0040.00420.54
8.3.10.0080.00023.65
8.3.00.0080.00023.52
8.2.290.0100.00820.43
8.2.280.0050.00920.35
8.2.270.0110.00716.95
8.2.260.0040.00416.78
8.2.250.0000.00818.19
8.2.240.0090.00018.71
8.2.230.0130.00620.94
8.2.220.0100.00024.06
8.2.210.0050.00226.77
8.2.200.0040.00416.50
8.2.190.0030.01816.63
8.2.180.0160.00616.75
8.2.170.0220.00022.96
8.2.160.0100.00322.20
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0090.00019.36
8.2.110.0060.00322.24
8.2.100.0040.00717.84
8.2.90.0060.00318.16
8.2.80.0060.00317.97
8.2.70.0060.00318.03
8.2.60.0050.00518.22
8.2.50.0040.00418.10
8.2.40.0050.00219.48
8.2.30.0040.00419.24
8.2.20.0000.00718.07
8.2.10.0000.00719.23
8.2.00.0040.00419.16
8.1.330.0120.00722.01
8.1.320.0080.01015.99
8.1.310.0140.00416.59
8.1.300.0090.00019.45
8.1.290.0050.00518.88
8.1.280.0040.01125.92
8.1.270.0030.00518.88
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0030.00620.96
8.1.230.0110.00021.03
8.1.220.0000.00817.80
8.1.210.0000.00918.84
8.1.200.0030.00617.35
8.1.190.0060.00317.23
8.1.180.0060.00318.10
8.1.170.0080.00018.50
8.1.160.0050.00218.98
8.1.150.0030.00518.79
8.1.140.0030.00322.05
8.1.130.0000.00720.02
8.1.120.0000.00817.47
8.1.110.0000.00717.46
8.1.100.0040.00417.45
8.1.90.0000.00717.52
8.1.80.0000.00717.47
8.1.70.0060.00317.41
8.1.60.0050.00317.55
8.1.50.0090.00017.56
8.1.40.0000.00917.46
8.1.30.0000.00817.64
8.1.20.0030.00617.60
8.1.10.0040.00417.54
8.1.00.0040.00417.51
8.0.300.0030.00519.89
8.0.290.0000.00716.75
8.0.280.0000.00818.45
8.0.270.0070.00017.32
8.0.260.0030.00318.43
8.0.250.0030.00316.84
8.0.240.0030.00316.91
8.0.230.0000.00716.98
8.0.220.0040.00416.95
8.0.210.0040.00416.85
8.0.200.0040.00416.82
8.0.190.0000.00717.01
8.0.180.0080.00016.93
8.0.170.0030.00516.87
8.0.160.0060.00316.95
8.0.150.0040.00416.69
8.0.140.0040.00416.76
8.0.130.0000.00613.36
8.0.120.0030.00516.89
8.0.110.0000.00716.96
8.0.100.0070.00016.76
8.0.90.0080.00016.77
8.0.80.0060.01016.85
8.0.70.0040.00416.81
8.0.60.0000.00716.80
8.0.50.0050.00316.85
8.0.30.0120.00917.16
8.0.20.0130.00817.40
8.0.10.0040.00416.85
8.0.00.0030.01816.99
7.4.330.0000.00515.55
7.4.320.0030.00316.66
7.4.300.0040.00416.57
7.4.290.0040.00416.55
7.4.280.0000.00816.57
7.4.270.0040.00416.43
7.4.260.0090.00016.39
7.4.250.0000.00716.47
7.4.240.0070.00016.61
7.4.230.0030.00316.41
7.4.220.0000.00716.31
7.4.210.0070.00916.59
7.4.200.0000.00816.50
7.4.160.0100.00616.45
7.4.140.0130.00617.86
7.4.130.0030.02116.65
7.4.120.0060.01516.50
7.4.110.0100.00716.71
7.4.100.0160.00716.55
7.4.90.0070.01416.49
7.4.80.0060.01619.39
7.4.70.0130.00616.45
7.4.60.0130.00516.65
7.4.50.0030.01016.57
7.4.40.0140.00316.61
7.4.00.0130.00314.72
7.3.330.0000.00513.38
7.3.320.0030.00313.29
7.3.310.0000.00716.32
7.3.300.0000.00616.33
7.3.290.0040.00416.45
7.3.280.0090.00516.40
7.3.260.0120.00716.51
7.3.240.0090.00916.44
7.3.230.0140.00416.41
7.3.210.0100.00716.44
7.3.200.0090.00616.36
7.3.190.0170.00716.42
7.3.180.0090.00616.44
7.3.170.0040.01816.47
7.3.160.0110.00616.38
7.3.10.0110.00716.19
7.3.00.0290.00715.61
7.2.330.0190.00016.74
7.2.320.0120.00616.69
7.2.310.0100.00716.74
7.2.300.0080.00816.46
7.2.290.0090.01616.71
7.2.130.0260.01115.83
7.2.120.0280.00415.64
7.2.110.0600.00415.65
7.2.100.0200.00815.88
7.2.90.0300.00615.88
7.2.80.0340.00815.78
7.2.70.0210.00915.88
7.2.60.0140.01015.86
7.2.50.0190.00515.85
7.2.40.0360.00015.70
7.2.30.0160.01115.80
7.2.20.0200.00615.60
7.2.10.0210.00415.54
7.2.00.0120.00815.97
7.1.250.0250.01014.61

preferences:
34.75 ms | 403 KiB | 5 Q