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;
Output for git.master, git.master_jit, rfc.property-hooks
Current regular expression: /wp/v2/templates/(?P<parent>([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)[\/\w%-]+)/revisions Matches "my_theme_name/my_template_id" IDs as expected. Matches "my_template_id" IDs. This is NOT expected. Fixed regular expression: /wp/v2/templates/(?P<parent>([^\/:<>\*\?"\|]+\/\/?[^\/:<>\*\?"\|]+)[\/\w%-]+)/revisions Matches "my_theme_name/my_template_id" IDs as expected. Doesn't match "my_template_id" IDs as expected.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.49 ms | 406 KiB | 5 Q