3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "19018216307,Public,\,k]'=system1-system2,20230914143505.5,1-050000,No"; $pattern = <<<'REGEX' ~(?nxx) (?# modifiers: - inline n: parenthesis act as non-capturing groups - inline xx: spaces are ignored even in character classes - global A: all the matches have to be contiguous ) # pattern ( (?!\A) , \K | \A ) # not at the start with a commas or at the start without [^ , \\ ]* ( \\ . [^ , \\ ]* )* # field content (all that isn't a comma nor # a backslash, or an escaped character) # check ( \z (*:END) )? # define a marker if the end of the string is reached ~A REGEX; if (preg_match_all($pattern, $str, $m) && isset($m['MARK'])) { $result = array_map(fn($s) => strtr($s, ['\\\\' => '\\', '\\' => '']), $m[0]); print_r($result); }

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.5.00.0110.01020.33
8.4.150.0020.00014.05
8.4.140.0120.00817.97
8.4.130.0090.00818.67
8.4.120.0110.00923.78
8.4.110.0050.00622.13
8.4.100.0130.00717.84
8.4.90.0100.01120.41
8.4.80.0090.00718.82
8.4.70.0100.01118.20
8.4.60.0070.00720.77
8.4.50.0140.00618.85
8.4.40.0070.01017.81
8.4.30.0100.01022.36
8.4.20.0090.01218.90
8.4.10.0110.00019.60
8.3.280.0140.00818.68
8.3.270.0100.01016.79
8.3.260.0050.00316.98
8.3.250.0090.00919.07
8.3.240.0130.00816.70
8.3.230.0100.00816.64
8.3.220.0110.00718.98
8.3.210.0090.00918.48
8.3.200.0070.00216.74
8.3.190.0130.00618.96
8.3.180.0180.00118.62
8.3.170.0180.00019.07
8.3.160.0030.00620.19
8.3.150.0090.00917.06
8.3.140.0030.00618.96
8.3.130.0070.01118.77
8.3.120.0100.00720.68
8.3.110.0040.00418.45
8.3.100.0040.00816.86
8.3.90.0030.00526.77
8.3.80.0030.00618.56
8.3.70.0170.00316.50
8.3.60.0070.00716.63
8.3.50.0150.00418.53
8.3.40.0090.00620.38
8.3.30.0040.01121.96
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0000.00926.16
8.2.290.0110.00820.68
8.2.280.0040.00518.90
8.2.270.0060.01317.36
8.2.260.0030.00616.78
8.2.250.0050.00316.74
8.2.240.0060.00918.94
8.2.230.0050.00320.94
8.2.220.0090.00924.06
8.2.210.0000.00826.77
8.2.200.0060.00318.66
8.2.190.0150.00316.75
8.2.180.0110.00717.00
8.2.170.0110.00419.16
8.2.160.0120.00322.96
8.2.150.0000.00725.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0100.00222.19
8.1.330.0090.01022.00
8.1.320.0120.00716.16
8.1.310.0080.00018.57
8.1.300.0080.00818.36
8.1.290.0040.00430.84
8.1.280.0040.01125.92
8.1.270.0080.00023.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0130.00017.48

preferences:
85.96 ms | 403 KiB | 5 Q