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: " . $m . "\nDOC: " . $doc . "\nIDOC: " . $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.0040.00819.20
8.3.110.0080.00020.94
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0070.00317.13
8.3.70.0090.00616.88
8.3.60.0070.01617.13
8.3.50.0110.01120.59
8.3.40.0120.00419.23
8.3.30.0160.00619.07
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0060.00326.16
8.2.240.0060.00317.51
8.2.230.0060.00322.58
8.2.220.0030.00637.54
8.2.210.0000.01026.77
8.2.200.0060.00316.75
8.2.190.0180.00416.58
8.2.180.0140.00725.92
8.2.170.0120.00319.04
8.2.160.0140.00722.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0030.00526.16
8.2.110.0110.00021.13
8.2.100.0000.01118.16
8.2.90.0040.00418.13
8.2.80.0050.00319.04
8.2.70.0030.00617.88
8.2.60.0030.00517.93
8.2.50.0090.00017.98
8.2.40.0040.00418.09
8.2.30.0040.00418.22
8.2.20.0040.00420.59
8.2.10.0000.00718.34
8.2.00.0040.00419.42
8.1.300.0000.00920.17
8.1.290.0090.00030.84
8.1.280.0040.01125.92
8.1.270.0030.00624.08
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0000.00919.45
8.1.230.0040.00817.89
8.1.220.0080.00017.88
8.1.210.0040.00418.77
8.1.200.0030.00617.60
8.1.190.0060.00317.48
8.1.180.0040.00418.79
8.1.170.0050.00317.62
8.1.160.0070.00018.87
8.1.150.0030.00518.73
8.1.140.0040.00417.63
8.1.130.0050.00217.59
8.1.120.0040.00417.48
8.1.110.0040.00417.63
8.1.100.0040.00417.51
8.1.90.0040.00417.56
8.1.80.0000.00817.54
8.1.70.0050.01017.53
8.1.60.0030.01617.76
8.1.50.0140.00417.56
8.1.40.0130.00617.57
8.1.30.0190.00017.68
8.1.20.0160.00317.71
8.1.10.0180.00017.75
8.1.00.0110.00717.48
8.0.300.0050.00218.77
8.0.290.0040.00417.13
8.0.280.0000.00718.55
8.0.270.0040.00417.02
8.0.260.0070.00017.15
8.0.250.0040.00417.26
8.0.240.0000.00817.12
8.0.230.0000.00817.21
8.0.220.0000.00817.26
8.0.210.0000.00817.22
8.0.200.0080.00817.06
8.0.190.0100.00517.06
8.0.180.0150.00017.09
8.0.170.0120.00317.20
8.0.160.0000.01317.12
8.0.150.0080.00417.13
8.0.140.0070.00716.95
8.0.130.0100.00517.15
8.0.120.0110.00417.10
8.0.110.0050.01017.19
8.0.100.0160.00017.06
8.0.90.0000.01517.22
8.0.80.0100.00517.18
8.0.70.0140.00017.11
8.0.60.0120.00417.13
8.0.50.0160.00017.21
8.0.30.0080.00717.15
8.0.20.0160.00017.22
8.0.10.0080.00817.05
7.4.330.0050.00015.55
7.4.320.0030.00316.72
7.4.300.0070.00416.91
7.4.290.0070.00416.71
7.4.280.0080.00316.80
7.4.270.0080.00316.71
7.4.260.0110.00016.70
7.4.250.0040.00716.78
7.4.240.0070.00316.87
7.4.230.0080.00516.77
7.4.220.0110.00316.93
7.4.210.0090.00316.89
7.4.200.0100.00216.91
7.4.190.0090.00316.80
7.4.180.0060.00616.84
7.4.160.0120.00016.61
7.4.150.0120.00016.78
7.4.140.0080.00416.55
7.4.130.0100.00316.81
7.4.120.0030.01016.73
7.4.110.0130.00016.64
7.4.100.0090.00316.80
7.4.90.0030.01016.68
7.4.80.0090.00516.73
7.4.70.0110.00016.79
7.4.60.0030.00916.81
7.4.50.0100.00016.75
7.4.40.0080.00316.66
7.4.30.0050.00516.64
7.4.20.0030.00616.68
7.4.10.0050.00516.71
7.4.00.0030.00616.75

preferences:
32.41 ms | 403 KiB | 5 Q