3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '43_this_2 is test'; preg_match('/(?P<test>\w+)/', $string, $matches); // basic syntax var_dump($matches['test']); preg_match('/(?<test>.+)/', $string, $matches); // alternative var_dump($matches['test']); preg_match("/(?'test'.+)/", $string, $matches); // alternative var_dump($matches['test']); echo preg_replace('/\{(\w+)\}/', '(?<\1>\w+)', '/users/{user}/photos/{photo}');

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.0040.01116.63
8.3.50.0070.00718.16
8.3.40.0180.00419.04
8.3.30.0070.00719.02
8.3.20.0070.00023.48
8.3.10.0030.00522.00
8.3.00.0060.00320.75
8.2.180.0130.01018.79
8.2.170.0070.01122.96
8.2.160.0100.00720.35
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0030.00626.16
8.2.110.0060.00621.30
8.2.100.0070.00320.44
8.2.90.0000.00920.01
8.2.80.0000.00819.40
8.2.70.0080.00017.93
8.2.60.0030.00518.09
8.2.50.0090.00018.10
8.2.40.0060.00319.48
8.2.30.0030.00619.21
8.2.20.0040.00418.03
8.2.10.0000.00819.16
8.2.00.0000.00719.20
8.1.280.0070.00725.92
8.1.270.0090.00022.46
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00622.14
8.1.230.0060.00620.82
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00420.90
8.1.160.0040.00418.99
8.1.150.0040.00418.80
8.1.140.0020.00520.30
8.1.130.0030.00520.02
8.1.120.0000.00817.58
8.1.110.0040.00417.50
8.1.100.0080.00017.52
8.1.90.0070.00017.54
8.1.80.0060.00617.47
8.1.70.0000.00717.49
8.1.60.0060.00317.70
8.1.50.0030.00517.58
8.1.40.0000.00917.54
8.1.30.0050.00317.64
8.1.20.0050.00517.64
8.1.10.0000.00817.79
8.1.00.0000.01117.66
8.0.300.0070.00019.63
8.0.290.0040.00416.88
8.0.280.0040.00418.52
8.0.270.0030.00317.25
8.0.260.0030.00320.07
8.0.250.0030.00317.12
8.0.240.0030.00317.13
8.0.230.0000.00716.94
8.0.220.0000.00716.92
8.0.210.0070.00016.87
8.0.200.0040.00417.04
8.0.190.0000.00716.91
8.0.180.0050.00317.07
8.0.170.0050.00316.94
8.0.160.0070.00016.99
8.0.150.0070.00017.01
8.0.140.0000.00716.97
8.0.130.0000.00513.44
8.0.120.0040.00416.84
8.0.110.0040.00416.98
8.0.100.0000.00716.89
8.0.90.0030.00617.02
8.0.80.0130.00716.98
8.0.70.0070.00016.85
8.0.60.0000.00716.93
8.0.50.0030.00516.91
8.0.30.0080.00817.08
8.0.20.0060.01317.10
8.0.10.0050.00317.00
8.0.00.0110.00717.02
7.4.330.0050.00015.55
7.4.320.0070.00016.78
7.4.300.0000.00616.73
7.4.290.0000.00816.67
7.4.280.0050.00316.80
7.4.270.0060.00016.81
7.4.260.0000.00613.33
7.4.250.0050.00316.63
7.4.240.0060.00216.65
7.4.230.0050.00316.83
7.4.220.0050.00216.62
7.4.210.0070.01116.72
7.4.200.0070.00016.74
7.4.130.0180.00016.59
7.4.120.0140.00616.72
7.4.110.0100.01416.78
7.4.100.0150.00316.52
7.4.90.0120.00916.53
7.4.80.0030.01519.39
7.4.70.0100.00716.73
7.4.60.0100.00716.63
7.4.50.0140.00316.29
7.4.40.0070.01016.73
7.4.00.0070.01215.25
7.3.330.0000.00716.29
7.3.320.0000.00613.29
7.3.310.0040.00316.48
7.3.300.0050.00316.38
7.3.290.0070.00016.14
7.3.280.0150.00616.44
7.3.260.0110.00916.55
7.3.240.0080.01116.63
7.3.230.0100.00716.48
7.3.210.0140.00316.67
7.3.200.0090.00916.50
7.3.190.0080.00816.47
7.3.180.0060.01016.81
7.3.170.0120.00616.54
7.3.160.0080.00816.50
7.3.120.0120.00615.14
7.3.110.0070.01015.04
7.3.100.0090.00914.71
7.3.90.0080.00715.03
7.3.80.0040.01114.90
7.3.70.0030.01314.91
7.3.60.0070.01014.85
7.3.50.0070.00914.95
7.3.40.0080.00914.99
7.3.30.0080.00414.79
7.3.20.0070.00615.85
7.3.10.0100.00215.93
7.3.00.0080.00815.69
7.2.330.0100.00716.65
7.2.320.0060.01616.65
7.2.310.0110.00616.66
7.2.300.0090.00916.74
7.2.290.0090.00916.57
7.2.250.0160.00415.32
7.2.240.0030.01315.33
7.2.230.0080.01115.04
7.2.220.0090.00714.96
7.2.210.0070.00914.84
7.2.200.0100.00515.03
7.2.190.0110.00615.04
7.2.180.0060.00914.99
7.2.170.0130.00515.02
7.2.160.0090.00615.29
7.2.150.0110.00515.30
7.2.140.0060.00915.31
7.2.130.0060.01215.02
7.2.120.0030.01314.98
7.2.110.0100.00715.18
7.2.100.0140.00315.08
7.2.90.0040.01515.19
7.2.80.0100.01015.34
7.2.70.0060.01315.27
7.2.60.0060.01015.32
7.2.50.0040.01115.20
7.2.40.0060.01015.36
7.2.30.0040.01615.04
7.2.20.0060.00915.07
7.2.10.0080.00815.07
7.2.00.0110.00815.18
7.1.330.0070.00715.84
7.1.320.0040.01215.14
7.1.310.0080.01014.98
7.1.300.0080.00915.11
7.1.290.0070.01215.11
7.1.280.0090.00714.89
7.1.270.0090.00615.08
7.1.260.0080.00514.91
7.1.250.0080.00813.99

preferences:
29.31 ms | 400 KiB | 5 Q