3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regular_expression = '/wp/v2/templates/(?P<parent>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)/revisions'; $current_rest_ednpoints_route_pattern = '@^' . $regular_expression . '$@i'; $request_uri = '/wp/v2/templates/my_theme_name//my_template_id/revisions'; echo 'Current regular expression: ' . $regular_expression . PHP_EOL . PHP_EOL; echo 1 === preg_match($current_rest_ednpoints_route_pattern, $request_uri) ? 'Matches "my_theme_name/my_template_id" IDs as expected.' : 'Doesn\'t match "my_theme_name/my_template_id" IDs. This is NOT expected.' ; echo PHP_EOL; $request_uri = '/wp/v2/templates/my_template_id/revisions'; echo 1 === preg_match($current_rest_ednpoints_route_pattern, $request_uri) ? 'Matches "my_template_id" IDs. This is NOT expected.' : 'Doesn\'t match "my_template_id" IDs as expected.' ; echo PHP_EOL . PHP_EOL; $fixed_regular_expression = '/wp/v2/templates/(?P<parent>([^\/:<>\*\?"\|]+\/\/?[^\/:<>\*\?"\|]+)[\/\w%-]+)/revisions'; $current_rest_ednpoints_route_pattern = '@^' . $fixed_regular_expression . '$@i'; $request_uri = '/wp/v2/templates/my_theme_name//my_template_id/revisions'; echo 'Fixed regular expression: ' . $fixed_regular_expression . PHP_EOL . PHP_EOL; echo 1 === preg_match($current_rest_ednpoints_route_pattern, $request_uri) ? 'Matches "my_theme_name/my_template_id" IDs as expected.' : 'Doesn\'t match "my_theme_name/my_template_id" IDs. This is NOT expected.' ; echo PHP_EOL; $request_uri = '/wp/v2/templates/my_template_id/revisions'; echo 1 === preg_match($current_rest_ednpoints_route_pattern, $request_uri) ? 'Matches "my_template_id" IDs. This is NOT expected.' : 'Doesn\'t match "my_template_id" IDs as expected.' ; echo PHP_EOL . PHP_EOL;

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.4.120.0150.00524.29
8.4.110.0080.01218.92
8.4.100.0080.00118.90
8.4.90.0100.00920.49
8.4.80.0110.00718.65
8.4.70.0100.01018.22
8.4.60.0090.00720.48
8.4.50.0100.00618.71
8.4.40.0140.00717.71
8.4.30.0070.01318.57
8.4.20.0140.00718.13
8.4.10.0030.00619.52
8.3.250.0110.00918.93
8.3.240.0120.00817.35
8.3.230.0100.00916.64
8.3.220.0120.00719.11
8.3.210.0080.00616.95
8.3.200.0070.00417.00
8.3.190.0040.00417.17
8.3.180.0090.00916.85
8.3.170.0140.00318.88
8.3.160.0120.00818.76
8.3.150.0060.00319.25
8.3.140.0080.00017.21
8.3.130.0030.00618.55
8.3.120.0060.00320.81
8.3.110.0050.00320.94
8.3.100.0090.00024.06
8.3.90.0080.00426.77
8.3.80.0030.00618.55
8.3.70.0040.01117.00
8.3.60.0150.00017.00
8.3.50.0120.00916.82
8.3.40.0040.01121.87
8.3.30.0060.00919.17
8.3.20.0000.00724.18
8.3.10.0050.00324.66
8.3.00.0090.00026.16
8.2.290.0050.00320.79
8.2.280.0130.00618.74
8.2.270.0070.01017.19
8.2.260.0050.00318.79
8.2.250.0030.00616.91
8.2.240.0120.00417.05
8.2.230.0130.00722.58
8.2.220.0100.00037.54
8.2.210.0110.00426.77
8.2.200.0000.01016.75
8.2.190.0090.00616.58
8.2.180.0130.00316.63
8.2.170.0100.00718.80
8.2.160.0100.01022.96
8.2.150.0000.00725.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00019.61
8.2.110.0110.01120.56
8.2.100.0120.01019.13
8.2.90.0140.00919.09
8.2.80.0110.01119.03
8.2.70.0120.00819.61
8.2.60.0120.01019.58
8.2.50.0110.01018.97
8.2.40.0110.01019.12
8.2.30.0110.00919.01
8.2.20.0140.00818.96
8.2.10.0080.00818.96
8.2.00.0090.01218.93
8.1.330.0130.00622.17
8.1.320.0090.01216.44
8.1.310.0140.00416.82
8.1.300.0000.01518.61
8.1.290.0060.00330.84
8.1.280.0090.00925.92
8.1.270.0080.00024.66
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0130.00618.65
8.1.230.0110.00618.75
8.1.220.0100.01018.83
8.1.210.0080.00220.19
8.1.200.0130.00418.71
8.1.190.0110.00818.61
8.1.180.0090.00818.59
8.1.170.0100.00418.81
8.1.160.0110.00418.90
8.1.150.0060.00818.84
8.1.140.0080.00918.78
8.1.130.0070.00718.81
8.1.120.0100.00718.86
8.1.110.0080.00918.78
8.1.100.0070.00818.71
8.1.90.0080.00918.85
8.1.80.0100.00118.76
8.1.70.0070.00618.78
8.1.60.0070.00518.97
8.1.50.0080.00218.89
8.1.40.0090.00318.92
8.1.30.0080.00619.00
8.1.20.0120.00118.91
8.1.10.0100.00218.91
8.1.00.0120.00418.82
8.0.300.0100.00518.08
8.0.290.0100.00218.00
8.0.280.0060.00418.10
8.0.270.0110.00118.09
8.0.260.0120.00018.06
8.0.250.0070.00418.20
8.0.240.0060.00318.17
8.0.230.0120.00518.17
8.0.220.0100.00818.16
8.0.210.0080.00918.11
8.0.200.0090.00718.18
8.0.190.0160.00318.19
8.0.180.0090.00418.20
8.0.170.0080.00918.22
8.0.160.0090.00918.09
8.0.150.0070.00518.04
8.0.140.0090.00918.01
8.0.130.0110.00218.13
8.0.120.0140.00418.01
8.0.110.0110.00818.13
8.0.100.0100.00418.09
8.0.90.0070.00618.04
8.0.80.0080.00618.64
8.0.70.0130.00617.96
8.0.60.0150.00318.05
8.0.50.0150.00518.03
8.0.30.0070.01017.98
8.0.20.0170.00418.13
8.0.10.0110.00118.18

preferences:
25.76 ms | 403 KiB | 5 Q