3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['submit'])) { $text = htmlspecialchars($_POST['input']); $lines = explode(PHP_EOL, $text); $bullets = array(); foreach ($lines as $line) { if (strlen($line) > 0) { preg_match("/([^\s]+)\s+(\w+)/", $line,$captured); if (count($captured) > 1 ) { if (strcmp($captured[1], end($bullets))) { if (count($bullets) > 1 && !strcmp($bullets[count($bullets)-2],$captured[1])) { echo '</ul>'; array_pop($bullets); } else { echo '<ul>'; array_push($bullets, $captured[1]); } } echo "<li>$captured[2]</li>"; } } } while (count($bullets)) { echo "</ul>"; array_pop($bullets); } } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="deformat"> Formatted data <textarea rows="4" cols="50" name="input" form="deformat" placeholder="pasted formatted text here"> </textarea> Deformatted data <textarea rows="4" cols="50" name="output" form="deformat"> </textarea> <input type="submit" name="submit" value="Clean my data!"> </form>

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.0070.01418.56
8.3.50.0120.00821.92
8.3.40.0110.00418.79
8.3.30.0080.00619.21
8.3.20.0040.00420.35
8.3.10.0040.00421.79
8.3.00.0030.00520.78
8.2.180.0090.00918.16
8.2.170.0160.00022.96
8.2.160.0070.00720.84
8.2.150.0060.00324.18
8.2.140.0000.00924.66
8.2.130.0090.00326.16
8.2.120.0070.00317.59
8.2.110.0030.00722.30
8.2.100.0060.00617.72
8.2.90.0000.00819.28
8.2.80.0000.00817.97
8.2.70.0090.00017.63
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0080.00018.22
8.2.30.0000.00718.00
8.2.20.0040.00417.67
8.2.10.0080.00017.69
8.2.00.0040.00417.62
8.1.280.0110.00425.92
8.1.270.0040.00422.24
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00923.80
8.1.230.0100.00019.08
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0000.00817.52
8.1.180.0000.00918.60
8.1.170.0060.00318.70
8.1.160.0040.00421.96
8.1.150.0040.00418.58
8.1.140.0070.00017.41
8.1.130.0030.00317.65
8.1.120.0000.00817.30
8.1.110.0070.00017.40
8.1.100.0040.00417.42
8.1.90.0000.00717.40
8.1.80.0030.00517.35
8.1.70.0000.00717.38
8.1.60.0000.00917.54
8.1.50.0030.00617.43
8.1.40.0000.00717.33
8.1.30.0030.00617.54
8.1.20.0000.00817.56
8.1.10.0040.00417.57
8.1.00.0000.00717.40
8.0.300.0000.00818.77
8.0.290.0040.00417.04
8.0.280.0000.00818.41
8.0.270.0040.00417.23
8.0.260.0030.00316.70
8.0.250.0020.00517.01
8.0.240.0070.00016.92
8.0.230.0030.00316.88
8.0.220.0030.00516.75
8.0.210.0000.00716.75
8.0.200.0030.00316.91
8.0.190.0040.00416.96
8.0.180.0000.00716.93
8.0.170.0040.00416.77
8.0.160.0050.00216.89
8.0.150.0070.00316.77
8.0.140.0000.00716.86
8.0.130.0030.00313.28
8.0.120.0080.00016.85
8.0.110.0000.00716.88
8.0.100.0000.00716.67
8.0.90.0060.00316.80
8.0.80.0150.00016.87
8.0.70.0040.00416.72
8.0.60.0000.00716.89
8.0.50.0050.00216.95
8.0.30.0090.00916.97
8.0.20.0060.01217.40
8.0.10.0050.00216.85
8.0.00.0140.00616.59
7.4.330.0050.00015.00
7.4.320.0000.00816.48
7.4.300.0000.00716.45
7.4.290.0000.00816.54
7.4.280.0000.01016.46
7.4.270.0030.00316.38
7.4.260.0040.00416.44
7.4.250.0000.00816.53
7.4.240.0030.00416.50
7.4.230.0000.00716.40
7.4.220.0100.00716.43
7.4.210.0060.01016.52
7.4.200.0050.00216.36
7.4.190.0040.00416.61
7.4.160.0030.01316.41
7.4.150.0110.00917.40
7.4.140.0120.00717.86
7.4.130.0070.01016.56
7.4.120.0130.00716.42
7.4.110.0100.00716.38
7.4.100.0150.00316.69
7.4.90.0090.00916.53
7.4.80.0120.00619.39
7.4.70.0050.01116.50
7.4.60.0110.00616.34
7.4.50.0080.00616.26
7.4.40.0080.01218.43
7.4.30.0070.01016.11
7.4.20.0160.00016.24
7.4.10.0120.00916.08
7.4.00.0070.00815.79
7.3.330.0020.00213.14
7.3.320.0020.00213.21
7.3.310.0050.00216.30
7.3.300.0000.00616.13
7.3.290.0090.01016.35
7.3.280.0110.00816.25
7.3.270.0130.00517.40
7.3.260.0100.01316.27
7.3.250.0110.00616.47
7.3.240.0140.00916.27
7.3.230.0100.00916.42
7.3.210.0100.00716.28
7.3.200.0090.00919.39
7.3.190.0070.01016.62
7.3.180.0060.01016.37
7.3.170.0060.01216.38
7.3.160.0100.01416.27
7.3.150.0130.01216.04
7.3.140.0120.00616.14
7.3.130.0100.00716.22
7.3.120.0100.00415.52
7.3.110.0070.01116.09
7.3.100.0040.01316.13
7.3.90.0060.01216.31
7.3.80.0130.00516.05
7.3.70.0100.00716.02
7.3.60.0080.00816.17
7.3.50.0040.01316.07
7.3.40.0080.01116.07
7.3.30.0120.00716.11
7.3.20.0070.01816.10
7.3.10.0130.00616.02
7.3.00.0290.00316.15
7.2.330.0060.01216.32
7.2.320.0120.00616.67
7.2.310.0090.00916.20
7.2.300.0020.01516.41
7.2.290.0080.00816.39
7.2.280.0200.00716.38
7.2.270.0070.01016.16
7.2.260.0150.00316.35
7.2.250.0060.01116.18
7.2.240.0040.01616.34
7.2.230.0150.00716.15
7.2.220.0060.01216.29
7.2.210.0170.00016.21
7.2.200.0110.00916.20
7.2.190.0110.00716.33
7.2.180.0160.00316.27
7.2.170.0150.00316.20
7.2.160.0140.01116.30
7.2.150.0110.01116.38
7.2.140.0060.01316.44
7.2.130.0170.00216.42
7.2.120.0000.01916.24
7.2.110.0260.00316.30
7.2.100.0120.00616.41
7.2.90.0110.01116.29
7.2.80.0060.01216.36
7.2.70.0120.01216.37
7.2.60.0120.00616.51
7.2.50.0080.00616.77
7.2.40.0110.00716.23
7.2.30.0180.01216.37
7.2.20.0150.00516.29
7.2.10.0070.01816.40
7.2.00.0070.01017.87
7.1.330.0080.01115.23
7.1.320.0170.00615.35
7.1.310.0120.00615.52
7.1.300.0100.01315.25
7.1.290.0090.00915.41
7.1.280.0060.01115.49
7.1.270.0150.00815.06
7.1.260.0120.00715.22
7.1.250.0080.00815.33
7.1.240.0100.00715.38
7.1.230.0130.00415.31
7.1.220.0040.01315.32
7.1.210.0120.00615.27
7.1.200.0080.00815.46
7.1.190.0160.00315.24
7.1.180.0180.00015.45
7.1.170.0090.00915.32
7.1.160.0110.00715.39
7.1.150.0080.01915.12
7.1.140.0140.00715.27
7.1.130.0100.01115.36
7.1.120.0140.00715.05
7.1.110.0160.00415.46
7.1.100.0060.00916.54
7.1.90.0050.01815.38
7.1.80.0150.01115.28
7.1.70.0070.00816.24
7.1.60.0120.00717.61
7.1.50.0110.01116.06
7.1.40.0070.01715.60
7.1.30.0130.00515.47
7.1.20.0150.00815.39
7.1.10.0200.00315.49
7.1.00.0100.04718.80
7.0.330.0100.00615.15
7.0.320.0130.00314.91
7.0.310.0160.00314.88
7.0.300.0070.01015.10
7.0.290.0060.01014.81
7.0.280.0240.00314.85
7.0.270.0040.01814.98
7.0.260.0070.01014.82
7.0.250.0070.01415.08
7.0.240.0060.01215.28
7.0.230.0100.00814.93
7.0.220.0140.00714.99
7.0.210.0080.01014.94
7.0.200.0080.00915.66
7.0.190.0190.01114.85
7.0.180.0130.00514.90
7.0.170.0140.00315.28
7.0.160.0160.00615.06
7.0.150.0180.01214.79
7.0.140.0050.04218.59
7.0.130.0160.00314.88
7.0.120.0150.01114.92
7.0.110.0030.01315.01
7.0.100.0130.00314.91
7.0.90.0220.00615.11
7.0.80.0080.02617.47
7.0.70.0120.01817.54
7.0.60.0100.01917.46
7.0.50.0070.02117.66
7.0.40.0130.02017.54
7.0.30.0090.02217.37
7.0.20.0080.02217.52
7.0.10.0110.04317.50
7.0.00.0140.04017.46
5.6.400.0110.00715.60
5.6.390.0110.00815.51
5.6.380.0180.00315.74
5.6.370.0100.00915.79
5.6.360.0110.00815.68
5.6.350.0180.00415.88
5.6.340.0090.01315.70
5.6.330.0110.01415.54
5.6.320.0170.00915.71
5.6.310.0080.01215.88
5.6.300.0110.00715.95
5.6.290.0140.00915.56
5.6.280.0160.03618.42
5.6.270.0040.01915.92
5.6.260.0180.00315.78
5.6.250.0140.01015.61
5.6.240.0100.01415.66
5.6.230.0100.02318.42
5.6.220.0060.02818.18
5.6.210.0040.02818.16
5.6.200.0020.02618.43
5.6.190.0070.02718.46
5.6.180.0150.03218.43
5.6.170.0100.04418.48
5.6.160.0060.03318.27
5.6.150.0140.04418.46
5.6.140.0120.02418.37
5.6.130.0100.04518.46
5.6.120.0100.03318.36
5.6.110.0090.04818.49
5.6.100.0090.02918.43
5.6.90.0100.04718.44
5.6.80.0160.04018.02
5.6.70.0050.03618.12
5.6.60.0110.04318.07
5.6.50.0110.02818.13
5.6.40.0070.04818.06
5.6.30.0030.03218.13
5.6.20.0110.03818.04
5.6.10.0090.02417.93
5.6.00.0090.04418.01
5.5.380.0170.00615.54
5.5.370.0070.02218.12
5.5.360.0080.02418.01
5.5.350.0070.02418.13
5.5.340.0070.02118.31
5.5.330.0110.02518.44
5.5.320.0150.04518.17
5.5.310.0080.02418.39
5.5.300.0070.03118.31
5.5.290.0110.02518.26
5.5.280.0120.04018.18
5.5.270.0110.03718.28
5.5.260.0080.03018.23
5.5.250.0110.04618.16
5.5.240.0120.04317.99
5.5.230.0130.03617.99
5.5.220.0100.02817.83
5.5.210.0050.05117.95
5.5.200.0070.02717.87
5.5.190.0060.05117.91
5.5.180.0070.03417.86
5.5.170.0120.01215.48
5.5.160.0100.03217.82
5.5.150.0110.04317.92
5.5.140.0110.03817.89
5.5.130.0050.04117.84
5.5.120.0070.02417.92
5.5.110.0090.03317.70
5.5.100.0100.04117.90
5.5.90.0080.02817.86
5.5.80.0110.04417.94
5.5.70.0070.03217.79
5.5.60.0090.04017.96
5.5.50.0070.02417.99
5.5.40.0090.02417.81
5.5.30.0090.04317.96
5.5.20.0030.04517.92
5.5.10.0130.04417.87
5.5.00.0170.01517.80
5.4.450.0020.03815.98
5.4.440.0070.04515.95
5.4.430.0070.04215.97
5.4.420.0060.02815.77
5.4.410.0080.04615.75
5.4.400.0090.04215.69
5.4.390.0060.04215.73
5.4.380.0090.01915.48
5.4.370.0110.03615.84
5.4.360.0100.03915.70
5.4.350.0060.04315.69
5.4.340.0090.03315.75
5.4.330.0110.00412.34
5.4.320.0050.04315.72
5.4.310.0060.03715.79
5.4.300.0070.04115.65
5.4.290.0130.02115.71
5.4.280.0080.03315.59
5.4.270.0080.02315.84
5.4.260.0100.03815.70
5.4.250.0070.04215.69
5.4.240.0110.03815.73
5.4.230.0060.04315.78
5.4.220.0090.03915.61
5.4.210.0050.04215.62
5.4.200.0080.01815.53
5.4.190.0100.01915.73
5.4.180.0030.04215.70
5.4.170.0050.03715.63
5.4.160.0080.02415.77
5.4.150.0120.03415.65
5.4.140.0070.02414.39
5.4.130.0080.03714.30
5.4.120.0070.02014.36
5.4.110.0040.04114.34
5.4.100.0130.03314.32
5.4.90.0080.03814.36
5.4.80.0070.01914.45
5.4.70.0100.03314.34
5.4.60.0080.03814.42
5.4.50.0050.04414.37
5.4.40.0070.04114.37
5.4.30.0030.03514.26
5.4.20.0100.03714.28
5.4.10.0120.03714.39
5.4.00.0090.02314.08
5.3.290.0070.02713.88
5.3.280.0090.03913.66
5.3.270.0030.03713.79
5.3.260.0060.04113.76
5.3.250.0090.02013.79
5.3.240.0020.02513.59
5.3.230.0110.03413.71
5.3.220.0070.04113.61
5.3.210.0090.02713.76
5.3.200.0050.02813.71
5.3.190.0070.02413.70
5.3.180.0040.02513.82
5.3.170.0070.03613.79
5.3.160.0070.02313.78
5.3.150.0050.04413.78
5.3.140.0070.04213.74
5.3.130.0030.02413.78
5.3.120.0070.04613.69
5.3.110.0070.02813.78
5.3.100.0060.03913.45
5.3.90.0020.04513.50
5.3.80.0070.04213.38
5.3.70.0140.03213.33
5.3.60.0070.03013.37
5.3.50.0030.02313.34
5.3.40.0050.03213.25
5.3.30.0090.03313.35
5.3.20.0030.03713.22
5.3.10.0020.02513.22
5.3.00.0050.02013.09
5.2.170.0070.01711.90
5.2.160.0050.03311.90
5.2.150.0060.01911.83
5.2.140.0080.01811.80
5.2.130.0000.02511.81
5.2.120.0080.01511.88
5.2.110.0040.01711.90
5.2.100.0000.02111.84
5.2.90.0030.03011.81
5.2.80.0070.03411.82
5.2.70.0040.02611.76
5.2.60.0040.03411.73
5.2.50.0080.03311.84
5.2.40.0040.03211.83
5.2.30.0000.03811.74
5.2.20.0080.03011.74
5.2.10.0040.03411.77
5.2.00.0070.02011.66
5.1.60.0080.02411.34
5.1.50.0040.02311.32
5.1.40.0050.02711.35
5.1.30.0060.01511.50
5.1.20.0000.02711.37
5.1.10.0030.01611.38
5.1.00.0070.02211.29
5.0.50.0050.01710.94
5.0.40.0040.02310.92
5.0.30.0050.02810.92
5.0.20.0080.01510.92
5.0.10.0050.01110.92
5.0.00.0060.03310.92
4.4.90.0000.02210.92
4.4.80.0030.02010.92
4.4.70.0010.02010.92
4.4.60.0060.00710.92
4.4.50.0000.01410.92
4.4.40.0030.02610.92
4.4.30.0000.01310.92
4.4.20.0030.00810.92
4.4.10.0000.01210.92
4.4.00.0040.02810.92
4.3.110.0010.02010.92
4.3.100.0010.01110.92
4.3.90.0040.00810.92
4.3.80.0030.02810.92
4.3.70.0020.01410.92
4.3.60.0020.01810.92
4.3.50.0020.01910.92
4.3.40.0020.02310.92
4.3.30.0010.02010.92
4.3.20.0020.01810.92
4.3.10.0030.01310.92
4.3.00.0020.01910.92

preferences:
44.95 ms | 401 KiB | 5 Q