3v4l.org

run code in 500+ PHP versions simultaneously
<?php namespace App\Util; class Regex { /** @return list<string> */ public static function match(string $pattern, string $subject): array { $matches = []; \Safe\preg_match($pattern, $subject, $matches); assert(is_array($matches)); return $matches; } public static function replace(string $pattern, string $replacement, string $subject, int $limit = -1): string { $result = \Safe\preg_replace($pattern, $replacement, $subject, $limit); assert(is_string($result)); // cannot be otherwise when the parameters are strings return $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.90.0090.00816.85
8.5.80.0070.01016.78
8.5.70.0110.00716.66
8.5.60.0100.00716.68
8.5.50.0110.00616.52
8.5.30.0170.00616.54
8.5.20.0300.01016.35
8.5.10.0330.00716.49
8.5.00.0340.00916.40
8.4.240.0110.01119.73
8.4.230.0150.00719.42
8.4.220.0030.00719.53
8.4.210.0170.00519.72
8.4.180.0220.00819.76
8.4.170.0220.00719.64
8.4.160.0250.00519.47
8.4.150.0250.00519.57
8.4.140.0230.00717.62
8.4.130.0330.01017.46
8.4.120.0350.01317.70
8.4.110.0370.00817.63
8.4.100.0350.00917.78
8.4.90.0370.00917.87
8.4.80.0310.00717.70
8.4.70.0350.00717.61
8.4.60.0380.00817.58
8.4.50.0370.00817.65
8.4.40.0280.00417.62
8.4.30.0210.00317.52
8.4.20.0240.00417.69
8.4.10.0180.00617.44
8.3.330.0160.00518.35
8.3.320.0080.01118.57
8.3.310.0120.01018.46
8.3.300.0160.01018.20
8.3.290.0230.00518.35
8.3.280.0250.00618.40
8.3.270.0280.00716.47
8.3.260.0300.01016.62
8.3.250.0300.00916.55
8.3.240.0360.00716.62
8.3.230.0340.00816.51
8.3.220.0340.00916.63
8.3.210.0390.00716.38
8.3.200.0340.00616.60
8.3.190.0310.00716.56
8.3.180.0330.00716.65
8.3.170.0390.00916.33
8.3.160.0340.00716.62
8.3.150.0290.00416.48
8.3.140.0220.00616.62
8.3.130.0200.00816.50
8.3.120.0270.00616.54
8.3.110.0150.00416.65
8.3.100.0250.00616.47
8.3.90.0230.00516.63
8.3.80.0180.00316.72
8.3.70.0190.00316.44
8.3.60.0250.00816.58
8.3.50.0320.01016.49
8.3.40.0290.00517.79
8.3.30.0190.00617.90
8.3.20.0180.00717.80
8.3.10.0180.00717.74
8.3.00.0200.00617.76
8.2.320.0110.00917.98
8.2.310.0100.00918.08
4.3.00.0060.00115.92

preferences:
45.15 ms | 754 KiB | 5 Q