3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "The time is over. # its mean I'm need to die. Please help me. # Ghost. I am here alone. Sorry. # help yourself."; function lines(string $str): generator { $hPos = strpos($str, "#"); if($hPos !== false) { $dPos = strpos($str, ".", $hPos); if($dPos !== false) { yield substr($str, $hPos + 1, $dPos - $hPos - 1); foreach(lines(substr($str, $dPos + 1)) as $line) { yield $line; } } } } foreach(lines($str) as $line) { printf("%s\n", $line); }

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.0120.00618.55
8.3.50.0120.00319.77
8.3.40.0090.00618.48
8.3.30.0070.00718.71
8.3.20.0040.00421.96
8.3.10.0060.00323.52
8.3.00.0070.00023.48
8.2.180.0110.00716.50
8.2.170.0040.01122.96
8.2.160.0140.00020.27
8.2.150.0000.00724.18
8.2.140.0000.00724.66
8.2.130.0040.00417.91
8.2.120.0070.00026.35
8.2.110.0030.00620.53
8.2.100.0090.00317.66
8.2.90.0040.00817.91
8.2.80.0000.00817.97
8.2.70.0080.00017.93
8.2.60.0040.00418.03
8.2.50.0040.00418.10
8.2.40.0050.00319.48
8.2.30.0040.00419.19
8.2.20.0000.00718.07
8.2.10.0000.00720.65
8.2.00.0050.00219.40
8.1.280.0040.01425.92
8.1.270.0030.00518.68
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00023.90
8.1.230.0040.00823.94
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0060.00317.13
8.1.180.0050.00318.10
8.1.170.0030.00518.59
8.1.160.0060.00318.80
8.1.150.0040.00420.59
8.1.140.0040.00422.15
8.1.130.0050.00320.12
8.1.120.0050.00217.53
8.1.110.0000.01117.53
8.1.100.0030.00517.52
8.1.90.0070.00017.43
8.1.80.0000.00817.38
8.1.70.0000.00717.46
8.1.60.0060.00317.49
8.1.50.0040.00417.54
8.1.40.0000.00817.57
8.1.30.0000.00717.66
8.1.20.0000.00717.49
8.1.10.0030.00517.45
8.1.00.0040.00417.41
8.0.300.0050.00319.63
8.0.290.0050.00316.75
8.0.280.0040.00418.38
8.0.270.0040.00417.27
8.0.260.0070.00018.31
8.0.250.0030.00616.88
8.0.240.0040.00417.04
8.0.230.0030.00316.97
8.0.220.0000.00716.94
8.0.210.0090.00016.81
8.0.200.0070.00016.93
8.0.190.0000.00917.00
8.0.180.0040.00416.98
8.0.170.0060.00316.81
8.0.160.0040.00416.77
8.0.150.0030.00616.88
8.0.140.0040.00416.89
8.0.130.0030.00313.32
8.0.120.0000.00816.80
8.0.110.0040.00416.79
8.0.100.0040.00416.85
8.0.90.0040.00416.88
8.0.80.0100.00816.84
8.0.70.0040.00417.01
8.0.60.0040.00416.95
8.0.50.0090.00016.93
8.0.30.0090.00916.93
8.0.20.0100.01017.40
8.0.10.0040.00417.00
8.0.00.0060.01216.69
7.4.330.0000.00516.75
7.4.320.0040.00416.59
7.4.300.0040.00416.66
7.4.290.0000.00716.62
7.4.280.0000.00816.65
7.4.270.0070.00016.54
7.4.260.0030.00316.47
7.4.250.0040.00416.66
7.4.240.0040.00416.43
7.4.230.0030.00316.46
7.4.220.0050.00316.61
7.4.210.0080.00716.54
7.4.200.0050.00216.60
7.4.160.0090.00816.45
7.4.140.0120.00917.86
7.4.130.0060.01316.54
7.4.120.0160.00416.54
7.4.110.0110.00716.44
7.4.100.0090.00916.46
7.4.90.0070.01016.57
7.4.80.0030.01619.39
7.4.70.0170.00516.41
7.4.60.0110.00816.50
7.4.50.0100.00716.41
7.4.40.0090.00616.46
7.4.00.0090.00715.14
7.3.330.0060.00013.19
7.3.320.0050.00013.35
7.3.310.0000.00716.48
7.3.300.0030.00316.24
7.3.290.0050.00316.42
7.3.280.0100.00716.35
7.3.260.0130.00516.53
7.3.240.0100.00716.51
7.3.230.0140.00716.39
7.3.210.0100.00716.43
7.3.200.0110.01116.54
7.3.190.0140.00416.38
7.3.180.0070.01016.61
7.3.170.0120.00416.36
7.3.160.0100.00716.29
7.3.120.0150.00414.88
7.3.110.0100.00715.13
7.3.100.0030.00915.04
7.3.90.0120.00614.72
7.3.80.0090.00615.02
7.3.70.0060.00614.75
7.3.60.0060.01014.78
7.3.50.0030.01014.94
7.3.40.0070.01014.97
7.3.30.0030.01014.77
7.3.20.0030.00716.76
7.3.10.0030.00916.61
7.3.00.1800.00714.84
7.2.330.0140.00416.53
7.2.320.0080.00916.41
7.2.310.0120.00916.85
7.2.300.0040.01716.50
7.2.290.0070.01016.58
7.2.250.0030.01315.31
7.2.240.0030.01415.14
7.2.230.0110.00715.09
7.2.220.0070.00715.11
7.2.210.0070.00715.27
7.2.200.0000.01615.06
7.2.190.0080.00415.20
7.2.180.0040.00814.90
7.2.170.0080.00415.02
7.2.130.0870.00914.78
7.2.120.2890.00614.82
7.2.110.1130.00714.87
7.2.100.1210.00814.46
7.2.90.2710.01114.69
7.2.80.2030.00414.61
7.2.70.2290.00614.99
7.2.60.1630.00715.02
7.2.50.1290.00714.79
7.2.40.1590.00714.82
7.2.30.2540.00714.92
7.2.20.3260.00515.07
7.2.10.2460.00915.02
7.2.00.2040.00814.98
7.1.330.0070.01115.85
7.1.320.0040.01115.54
7.1.310.0070.00715.59
7.1.300.0000.00915.85
7.1.290.0080.00415.85
7.1.280.0040.00415.57
7.1.270.0000.01115.76
7.1.260.0090.00315.46
7.1.250.1860.00713.85
7.0.330.2690.00413.46
5.6.380.0070.00814.09

preferences:
56.96 ms | 401 KiB | 5 Q