3v4l.org

run code in 300+ PHP versions simultaneously
<?php $name1 = 'The cat is red and wet'; $name2 = 'The cat is green and wet'; function stringDiff($string1, $string2) { $x = str_split($string1); $y = str_split($string2); $diff = array_diff($x, $y); foreach ($diff as $letter) { $string1 = str_replace($letter, '-', $string1); } return $string1; } var_dump(stringDiff($name1, $name2));

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.3.60.0140.00716.50
8.3.50.0070.01116.48
8.3.40.0110.00718.75
8.3.30.0040.01118.62
8.3.20.0040.00420.38
8.3.10.0050.00322.09
8.3.00.0040.00423.51
8.2.180.0110.00716.50
8.2.170.0110.00422.96
8.2.160.0100.01020.44
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0040.00420.27
8.2.120.0080.00026.35
8.2.110.0060.00320.47
8.2.100.0040.00718.03
8.2.90.0050.00318.16
8.2.80.0080.00018.03
8.2.70.0040.00417.80
8.2.60.0060.00318.09
8.2.50.0040.00418.10
8.2.40.0050.00322.20
8.2.30.0060.00319.25
8.2.20.0040.00418.23
8.2.10.0080.00018.12
8.2.00.0040.00418.04
8.1.280.0060.01025.92
8.1.270.0040.00422.10
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0120.00820.68
8.1.230.0100.00021.04
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0050.00318.75
8.1.160.0040.00418.87
8.1.150.0040.00420.18
8.1.140.0030.00617.40
8.1.130.0000.00720.14
8.1.120.0080.00017.48
8.1.110.0040.00417.40
8.1.100.0000.00917.52
8.1.90.0080.00017.42
8.1.80.0000.00717.52
8.1.70.0030.00717.46
8.1.60.0030.00617.60
8.1.50.0030.00517.40
8.1.40.0000.00717.54
8.1.30.0000.00717.57
8.1.20.0070.00017.58
8.1.10.0040.00317.47
8.1.00.0030.00717.30
8.0.300.0000.00819.66
8.0.290.0040.00716.63
8.0.280.0030.00318.44
8.0.270.0070.00017.26
8.0.260.0090.00020.19
8.0.250.0030.00317.00
8.0.240.0050.00316.94
8.0.230.0000.00816.99
8.0.220.0070.00016.76
8.0.210.0030.00316.80
8.0.200.0030.00317.01
8.0.190.0040.00416.97
8.0.180.0030.00316.79
8.0.170.0000.00716.91
8.0.160.0040.00416.78
8.0.150.0040.00816.91
8.0.140.0030.00516.85
8.0.130.0020.00413.38
8.0.120.0050.00216.80
8.0.110.0000.00816.75
8.0.100.0000.00716.67
8.0.90.0040.00417.00
8.0.80.0160.00916.92
8.0.70.0040.00416.72
8.0.60.0040.00416.88
8.0.50.0000.00716.85
8.0.30.0090.01017.13
8.0.20.0110.01217.40
8.0.10.0040.00416.88
8.0.00.0070.01016.72
7.4.330.0000.00515.55
7.4.320.0030.00316.50
7.4.300.0040.00416.49
7.4.290.0050.00316.43
7.4.280.0040.00416.64
7.4.270.0070.00016.41
7.4.260.0030.00316.58
7.4.250.0080.00016.48
7.4.240.0000.00816.49
7.4.230.0040.00416.42
7.4.220.0150.01216.62
7.4.210.0090.00916.55
7.4.200.0000.00716.59
7.4.160.0060.01116.45
7.4.150.0110.01217.40
7.4.140.0080.01017.86
7.4.130.0070.01616.56
7.4.120.0090.00916.55
7.4.110.0130.00916.71
7.4.100.0100.00616.66
7.4.90.0000.01716.61
7.4.80.0070.01419.39
7.4.70.0090.01316.40
7.4.60.0130.00716.51
7.4.50.0030.01316.20
7.4.40.0100.00716.56
7.4.30.0140.00716.30
7.4.00.0050.01115.02
7.3.330.0000.00613.30
7.3.320.0030.00313.27
7.3.310.0050.00216.33
7.3.300.0070.00016.19
7.3.290.0080.00916.29
7.3.280.0100.00716.30
7.3.270.0050.01117.40
7.3.260.0140.00316.40
7.3.250.0090.00816.32
7.3.240.0080.00916.56
7.3.230.0090.00616.37
7.3.210.0080.00816.76
7.3.200.0030.01316.24
7.3.190.0100.00616.41
7.3.180.0100.01316.54
7.3.170.0140.00716.48
7.3.160.0080.00816.57
7.3.120.0000.01714.65
7.3.110.0060.01014.87
7.3.100.0030.01214.86
7.3.90.0070.00714.71
7.3.80.0140.00014.63
7.3.70.0090.00614.75
7.3.60.0110.00414.82
7.3.50.0090.00314.62
7.3.40.0090.00414.66
7.3.30.0110.00014.61
7.3.20.0080.00416.79
7.3.10.0000.00916.30
7.3.00.0030.00716.70
7.2.330.0090.00916.50
7.2.320.0120.01116.52
7.2.310.0060.01216.64
7.2.300.0040.01516.67
7.2.290.0060.01216.67
7.2.250.0030.01615.11
7.2.240.0100.01014.91
7.2.230.0060.00614.72
7.2.220.0040.01214.90
7.2.210.0040.01114.98
7.2.200.0090.00914.84
7.2.190.0060.00615.13
7.2.180.0030.00915.01
7.2.170.0100.00715.07
7.2.60.0070.00717.02
7.1.330.0100.00715.91
7.1.320.0000.01215.77
7.1.310.0060.00615.82
7.1.300.0070.00315.57
7.1.290.0040.01115.63
7.1.280.0040.00815.71
7.1.270.0050.00815.76
7.1.260.0030.00615.77
7.1.200.0060.00615.80
7.1.101.2730.00716.37
7.1.90.0050.01116.46
7.1.80.0770.00916.26
7.1.70.0070.01115.03
7.1.60.0440.00933.40
7.1.50.0220.01133.11
7.1.40.0240.01732.49
7.1.30.0170.02032.69
7.1.20.0240.01032.84
7.1.10.8390.00314.64
7.1.01.2650.01614.74
7.0.240.0100.01015.79
7.0.230.0110.00815.57
7.0.220.9330.01615.44
7.0.210.0260.00314.82
7.0.200.0100.00514.80
7.0.190.8210.01314.77
7.0.180.4870.00714.61
7.0.170.0090.00914.61
7.0.160.0100.01014.21
7.0.151.0320.01314.47
7.0.141.3640.00714.44
7.0.131.2030.01214.64
7.0.121.0440.00314.63
7.0.110.6980.00714.72
7.0.100.9320.00714.56
7.0.90.6270.01014.64
7.0.80.6340.01014.44
7.0.70.0800.01014.56
7.0.60.0060.01514.33
7.0.50.0340.01214.61
7.0.40.0140.00714.66
7.0.30.0710.00314.46
7.0.20.0450.00614.55
7.0.10.0130.01014.54
7.0.00.0100.00714.55

preferences:
60.93 ms | 400 KiB | 5 Q