3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<FOO #Doc 1 ## #Doc1.1 #Doc 1.2 mine_sht : carftj ### 漢字漢字貔貅 (Random chinese symbols) tv: tee # # HI tvw: 9 #Inline doc #aa 9abaa: ahah #heuens FOO; preg_match_all('~^\s*(?:(\w+)\s*:.[^\r\n#]*([^\r\n]*#*)?)?(#*(?:[^\r\n]|[\r\n]#)*)~um', $data, $matches); ///print_r($matches); $doc = ""; foreach($matches[1] as $i => $m) { $s = preg_replace('/\s+/', '', $m); //Remove whitespace if (str_starts_with($s, "#") || empty($s)){ //Valid next comment line $doc .= $matches[3][$i] . PHP_EOL; //Adding comments //print("DOC LOG: " . $doc . PHP_EOL); //LOG DOC continue; } print("KEY:\n" . $m . "\nDOC:\n" . $doc . "\nIDOC:\n" . $matches[2][$i] . "\n"); print("--------------------------------------------------\n"); $doc = $matches[3][$i]; //print("OPEN: ". $m . "-CLOSED\n"); }

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.120.0070.00719.24
8.3.110.0000.00816.98
8.3.100.0120.00316.92
8.3.90.0030.00626.77
8.3.80.0030.00717.13
8.3.70.0090.00617.00
8.3.60.0120.00618.70
8.3.50.0040.01418.73
8.3.40.0130.00319.19
8.3.30.0080.00819.17
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.240.0060.01018.53
8.2.230.0070.01020.94
8.2.220.0070.01324.06
8.2.210.0060.00926.77
8.2.200.0090.00016.88
8.2.190.0070.01616.88
8.2.180.0110.01125.92
8.2.170.0160.00319.25
8.2.160.0070.00722.96
8.2.150.0120.00325.66
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0080.00026.16
8.2.110.0000.01020.51
8.2.100.0040.00718.16
8.2.90.0050.00319.98
8.2.80.0030.00518.83
8.2.70.0080.00017.75
8.2.60.0000.00817.75
8.2.50.0040.00417.98
8.2.40.0000.00818.28
8.2.30.0040.00418.31
8.2.20.0040.00420.49
8.2.10.0000.00818.18
8.2.00.0080.00019.41
8.1.300.0090.00018.82
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0110.00723.99
8.1.260.0040.00426.35
8.1.250.0110.00828.09
8.1.240.0100.00023.98
8.1.230.0070.00320.85
8.1.220.0000.00817.74
8.1.210.0090.00018.77
8.1.200.0050.00317.48
8.1.190.0030.00517.48
8.1.180.0000.00918.10
8.1.170.0040.00417.62
8.1.160.0080.00018.96
8.1.150.0080.00018.75
8.1.140.0080.00017.67
8.1.130.0030.00518.93
8.1.120.0000.00717.57
8.1.110.0000.00817.67
8.1.100.0000.00717.59
8.1.90.0000.00717.59
8.1.80.0000.00917.63
8.1.70.0030.00317.52
8.1.60.0060.00617.80
8.1.50.0120.00717.64
8.1.40.0190.00017.69
8.1.30.0200.00017.74
8.1.20.0120.00817.74
8.1.10.0150.00417.70
8.1.00.0110.00817.73
8.0.300.0040.00419.98
8.0.290.0030.00617.13
8.0.280.0000.00718.50
8.0.270.0050.00317.06
8.0.260.0000.00618.55
8.0.250.0070.00017.25
8.0.240.0030.00317.25
8.0.230.0080.00017.28
8.0.220.0000.00717.11
8.0.210.0030.00317.28
8.0.200.0030.00317.17
8.0.190.0100.00517.14
8.0.180.0110.00417.14
8.0.170.0150.00016.99
8.0.160.0110.00517.02
8.0.150.0080.00817.13
8.0.140.0140.00217.13
8.0.130.0050.00917.18
8.0.120.0130.00417.08
8.0.110.0110.00417.26
8.0.100.0090.00617.09
8.0.90.0130.00317.20
8.0.80.0120.00317.21
8.0.70.0100.00717.16
8.0.60.0130.00317.24
8.0.50.0060.00917.19
8.0.30.0080.00817.05
8.0.20.0140.00317.13
8.0.10.0100.00517.36
7.4.330.0060.00015.55
7.4.320.0030.00316.80
7.4.300.0000.00716.89
7.4.290.0170.00016.88
7.4.280.0180.00016.62
7.4.270.0130.00216.82
7.4.260.0120.00216.75
7.4.250.0070.00716.61
7.4.240.0120.00616.74
7.4.230.0130.00416.86
7.4.220.0060.00916.85
7.4.210.0090.00616.85
7.4.200.0100.00516.65
7.4.190.0140.00016.75
7.4.180.0110.00416.79
7.4.160.0140.00016.82
7.4.150.0050.00816.56
7.4.140.0100.00516.76
7.4.130.0080.00816.75
7.4.120.0100.00516.86
7.4.110.0110.00416.87
7.4.100.0150.00016.88
7.4.90.0090.00616.61
7.4.80.0080.00816.68
7.4.70.0090.00516.65
7.4.60.0090.00616.66
7.4.50.0060.00916.65
7.4.40.0110.00416.52
7.4.30.0070.00716.73
7.4.20.0110.00416.56
7.4.10.0120.00316.75
7.4.00.0050.01016.70

preferences:
30.55 ms | 403 KiB | 5 Q