3v4l.org

run code in 300+ PHP versions simultaneously
<?php function doIt(string $line): string { $pos = strrpos($line, "&gt;"); if ($pos === false) { return $line; } if ($pos < 4 || substr($line, $pos - 4, 8) === "&gt;&gt;") { return $line; } return substr_replace($line, '<p style="color:#0f0;">', $pos, 0) . "</p>"; } function doItMultiline(string $owo): string { return implode(array_map('doIt', explode(PHP_EOL, $owo)), PHP_EOL); } $line = "awoo&gt;&gt;owo &gt;blyat lolis"; $line2 = "awoo&gt;&gt;owo"; var_dump(doItMultiline($line)); var_dump(doItMultiline($line2));

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.20.0170.00319.73
8.4.10.0160.00318.31
8.3.150.0000.00817.01
8.3.140.0120.00617.30
8.3.130.0040.00418.73
8.3.120.0190.00018.81
8.3.110.0090.00016.91
8.3.100.0070.01316.76
8.3.90.0080.00026.77
8.3.80.0040.00818.43
8.3.70.0120.00316.88
8.3.60.0120.00918.31
8.3.50.0070.00818.28
8.3.40.0150.00018.69
8.3.30.0030.01218.84
8.3.20.0040.00421.90
8.3.10.0080.00023.66
8.3.00.0040.00419.67
8.2.260.0140.00418.92
8.2.250.0030.00518.39
8.2.240.0060.00318.80
8.2.230.0000.00920.94
8.2.220.0090.00037.54
8.2.210.0040.00426.77
8.2.200.0060.00318.54
8.2.190.0110.00316.58
8.2.180.0140.00418.61
8.2.170.0030.01722.96
8.2.160.0130.01019.16
8.2.150.0080.00024.18
8.2.140.0070.00024.66
8.2.130.0060.00321.21
8.2.120.0080.00026.35
8.2.110.0030.00622.27
8.2.100.0110.00017.91
8.2.90.0000.00818.03
8.2.80.0040.00419.14
8.2.70.0040.00417.91
8.2.60.0050.00318.16
8.2.50.0030.00618.10
8.2.40.0060.00319.47
8.2.30.0040.00419.43
8.2.20.0050.00317.94
8.2.10.0040.00418.19
8.2.00.0000.00818.13
8.1.310.0080.00016.60
8.1.300.0040.00418.41
8.1.290.0060.00318.88
8.1.280.0180.00325.92
8.1.270.0070.00024.02
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0040.00422.61
8.1.230.0040.00720.96
8.1.220.0040.00417.88
8.1.210.0080.00018.80
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0080.00018.10
8.1.170.0030.00718.70
8.1.160.0000.00718.95
8.1.150.0000.00718.93
8.1.140.0030.00517.60
8.1.130.0000.00718.96
8.1.120.0040.00417.45
8.1.110.0040.00417.49
8.1.100.0030.00317.35
8.1.90.0000.00817.35
8.1.80.0040.00417.35
8.1.70.0040.00417.47
8.1.60.0000.00717.63
8.1.50.0030.00617.51
8.1.40.0050.00317.54
8.1.30.0080.00017.67
8.1.20.0000.00817.64
8.1.10.0040.00417.47
8.1.00.0050.00317.49
8.0.300.0040.00420.16
8.0.290.0060.00316.88
8.0.280.0040.00418.44
8.0.270.0030.00317.17
8.0.260.0030.00317.25
8.0.250.0000.00717.05
8.0.240.0030.00317.04
8.0.230.0000.00816.96
8.0.220.0080.00016.90
8.0.210.0030.00316.96
8.0.200.0030.00616.89
8.0.190.0000.00916.92
8.0.180.0040.00416.89
8.0.170.0040.00416.88
8.0.160.0000.00716.92
8.0.150.0040.00416.98
8.0.140.0040.00416.95
8.0.130.0030.00313.43
8.0.120.0070.00016.96
8.0.110.0020.00517.07
8.0.100.0070.00016.98
8.0.90.0040.00416.84
8.0.80.0040.01117.01
8.0.70.0030.00517.07
8.0.60.0040.00417.00
8.0.50.0000.00816.98
8.0.30.0100.01117.07
8.0.20.0120.00817.40
8.0.10.0040.00417.05
8.0.00.0100.00916.77
7.4.330.0000.00415.55
7.4.320.0060.00016.62
7.4.300.0000.00616.62
7.4.290.0080.00016.46
7.4.280.0050.00216.60
7.4.270.0070.00016.51
7.4.260.0030.00316.49
7.4.250.0060.00316.43
7.4.240.0030.00316.53
7.4.230.0000.00716.41
7.4.220.0080.00016.59
7.4.210.0060.01116.60
7.4.200.0030.00316.70
7.4.160.0070.00916.54
7.4.140.0110.00817.86
7.4.130.0070.01116.67
7.4.120.0100.00916.65
7.4.110.0080.00816.59
7.4.100.0110.01116.55
7.4.90.0100.00716.63
7.4.80.0070.01719.39
7.4.70.0080.00816.60
7.4.60.0090.00616.54
7.4.50.0120.00016.52
7.4.40.0100.00716.48
7.4.10.0100.00714.95
7.4.00.0070.01014.99
7.3.330.0050.00013.36
7.3.320.0000.00513.23
7.3.310.0030.00616.43
7.3.300.0000.00716.43
7.3.290.0070.00016.26
7.3.280.0110.00816.38
7.3.260.0120.00716.51
7.3.240.0090.00816.49
7.3.230.0100.00716.38
7.3.210.0090.00916.64
7.3.200.0060.01216.39
7.3.190.0160.00716.43
7.3.180.0060.01016.58
7.3.170.0080.00816.53
7.3.160.0120.00316.59
7.3.130.0060.00914.84
7.3.120.0060.01214.53
7.3.110.0000.01614.93
7.3.100.0030.01314.82
7.3.90.0000.00815.11
7.3.80.0030.01015.22
7.3.70.0090.00614.79
7.3.60.0030.01014.64
7.3.50.0030.00614.87
7.3.40.0050.00514.92
7.3.30.0030.01015.00
7.3.20.0060.00316.63
7.3.10.0110.00316.69
7.3.00.0070.01016.39
7.2.330.0130.00416.81
7.2.320.0090.01216.69
7.2.310.0090.00916.42
7.2.300.0060.01116.54
7.2.290.0090.00916.73
7.2.260.0070.01315.16
7.2.250.0070.01314.99
7.2.240.0000.01515.09
7.2.230.0090.00615.02
7.2.220.0030.01214.75
7.2.210.0080.00015.18
7.2.200.0000.01214.96
7.2.190.0070.00715.16
7.2.180.0060.00614.75
7.2.170.0030.01014.86
7.2.160.0030.00615.06
7.2.150.0120.00316.86
7.2.140.0000.01216.69
7.2.130.0130.00316.86
7.2.120.0000.01216.64
7.2.110.0000.01216.77
7.2.100.0070.00716.92
7.2.90.0110.00416.79
7.2.80.0130.00317.05
7.2.70.0110.00716.79
7.2.60.0080.00716.69
7.2.50.0080.00816.89
7.2.40.0710.01117.43
7.2.30.0650.01317.42
7.2.20.0750.01117.39
7.2.10.0500.01017.24
7.2.00.0450.01017.43
7.1.330.0100.00315.62
7.1.320.0040.00415.86
7.1.310.0090.00015.89
7.1.300.0130.00015.96
7.1.290.0100.00315.90
7.1.280.0030.00615.70
7.1.270.0060.00915.81
7.1.260.0030.01015.71
7.1.250.0050.00815.88
7.1.240.0060.00615.92
7.1.230.0000.01815.79
7.1.220.0000.01415.64
7.1.210.0060.00615.88
7.1.200.0090.00415.70
7.1.190.0000.00915.73
7.1.180.0090.00615.86
7.1.170.0000.01315.80
7.1.160.0500.01016.25
7.1.150.1010.00616.41
7.1.140.0730.01116.28
7.1.130.0430.00916.16
7.1.120.0520.00716.30
7.1.110.0440.00815.94
7.1.100.0620.01016.07
7.1.90.0320.01016.05
7.1.80.0330.01316.08
7.1.70.0590.00915.67
7.1.60.0570.01524.69
7.1.50.0500.01124.48
7.1.40.0450.00624.14
7.1.30.0380.01124.33
7.1.20.0410.00824.28
7.1.10.0290.00915.26
7.1.00.0510.00915.33
7.0.330.0090.00615.50
7.0.320.0000.01515.60
7.0.310.0030.01315.49
7.0.300.0000.01215.45
7.0.290.0100.00715.25
7.0.280.0080.00315.46
7.0.270.0080.00415.49
7.0.260.0090.00015.51
7.0.250.0000.01115.42
7.0.240.0070.00415.34
7.0.230.0060.00315.48
7.0.220.0030.01015.50
7.0.210.0030.00915.57
7.0.200.0080.00415.25
7.0.190.0030.01015.55
7.0.180.0030.01015.30
7.0.170.0000.01215.39
7.0.160.0100.00615.33
7.0.150.0060.00615.27
7.0.140.0080.00415.22
7.0.130.0000.01015.61
7.0.120.0040.00815.51
7.0.110.0030.00615.16
7.0.100.0060.00615.45
7.0.90.0070.01015.30
7.0.80.0070.00715.64
7.0.70.0130.00315.39
7.0.60.0030.00615.38
7.0.50.0060.00615.50
7.0.40.0060.00613.51
7.0.30.0080.00813.45
7.0.20.0070.00413.50
7.0.10.0060.00613.55
7.0.00.0060.00613.53
5.6.400.0060.00614.00
5.6.390.0000.01414.30
5.6.380.0030.00913.95
5.6.370.0060.00914.11
5.6.360.0030.00614.27
5.6.350.0120.00313.98
5.6.340.0000.01514.01
5.6.330.0040.01114.12
5.6.320.0070.00714.03
5.6.310.0040.00813.97
5.6.300.0130.00314.46
5.6.290.0030.00714.12
5.6.280.0040.00414.10
5.6.270.0000.01014.24
5.6.260.0080.00014.11
5.6.250.0110.00414.23
5.6.240.0030.01314.21
5.6.230.0100.00614.05
5.6.220.0000.00914.17
5.6.210.0030.01014.27
5.6.200.0030.01214.24
5.6.190.0000.01213.97
5.6.180.0030.01014.11
5.6.170.0060.00913.96
5.6.160.0100.00314.06
5.6.150.0030.01014.38
5.6.140.0070.00714.18
5.6.130.0030.00914.07
5.6.120.0030.00614.26
5.6.110.0120.00314.34
5.6.100.0070.00714.34
5.6.90.0070.00713.85
5.6.80.0040.00414.16
5.6.70.0000.01013.86
5.6.60.0030.01014.11
5.6.50.0030.00613.79
5.6.40.0080.00514.11
5.6.30.0030.01014.22
5.6.20.0000.01213.98
5.6.10.0000.01613.89
5.6.00.0060.00914.23

preferences:
34.43 ms | 403 KiB | 5 Q