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.5.10.0080.01416.69
8.5.00.0120.00920.36
8.4.150.0020.00014.05
8.4.140.0150.00617.73
8.4.130.0110.00918.75
8.4.120.0080.01122.10
8.4.110.0110.01022.51
8.4.100.0090.00717.88
8.4.90.0080.01017.96
8.4.80.0120.00619.68
8.4.70.0140.00717.93
8.4.60.0080.00418.59
8.4.50.0140.00419.84
8.4.40.0030.00517.75
8.4.30.0100.01018.76
8.4.20.0000.00918.20
8.4.10.0160.00319.38
8.3.280.0100.01018.41
8.3.270.0120.01116.65
8.3.260.0100.00916.86
8.3.250.0100.00818.88
8.3.240.0110.00717.06
8.3.230.0050.00316.87
8.3.220.0130.00616.78
8.3.210.0110.00916.73
8.3.200.0140.00616.99
8.3.190.0120.00818.52
8.3.180.0110.01019.16
8.3.170.0070.01018.65
8.3.160.0070.01318.53
8.3.150.0160.00318.94
8.3.140.0060.01217.16
8.3.130.0040.00418.36
8.3.120.0000.00920.52
8.3.110.0070.00420.94
8.3.100.0080.00824.06
8.3.90.0080.00026.77
8.3.80.0090.00017.97
8.3.70.0160.00318.68
8.3.60.0110.00418.29
8.3.50.0070.01316.55
8.3.40.0110.00321.93
8.3.30.0000.01519.17
8.3.20.0080.00024.18
8.3.10.0080.00024.66
8.3.00.0120.00826.16
8.2.290.0130.00720.62
8.2.280.0110.00718.53
8.2.270.0030.01617.31
8.2.260.0080.00018.75
8.2.250.0030.00616.73
8.2.240.0080.00017.32
8.2.230.0040.00422.58
8.2.220.0000.01937.54
8.2.210.0060.00326.77
8.2.200.0090.00016.75
8.2.190.0110.01118.54
8.2.180.0180.00716.88
8.2.170.0140.00418.80
8.2.160.0120.00322.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00417.88
8.2.110.0110.01120.41
8.2.100.0120.00919.02
8.2.90.0130.01019.08
8.2.80.0160.00718.77
8.2.70.0090.01218.97
8.2.60.0200.00319.01
8.2.50.0030.02118.84
8.2.40.0120.01218.96
8.2.30.0070.01418.91
8.2.20.0160.00619.13
8.2.10.0100.01419.02
8.2.00.0180.00318.94
8.1.330.0120.00720.16
8.1.320.0130.00716.19
8.1.310.0070.00317.00
8.1.300.0030.00618.24
8.1.290.0090.00030.84
8.1.280.0040.01125.92
8.1.270.0050.00224.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0150.00818.87
8.1.230.0100.01018.82
8.1.220.0220.00018.88
8.1.210.0160.00720.19
8.1.200.0110.01118.76
8.1.190.0140.01018.55
8.1.180.0090.00918.69
8.1.170.0030.00718.86
8.1.160.0070.01518.82
8.1.150.0120.00618.68
8.1.140.0130.00718.72
8.1.130.0040.01218.86
8.1.120.0080.00318.92
8.1.110.0100.01318.80
8.1.100.0100.00718.79
8.1.90.0100.01318.80
8.1.80.0100.00018.94
8.1.70.0030.00618.88
8.1.60.0030.01518.96
8.1.50.0130.01018.71
8.1.40.0130.01018.88
8.1.30.0200.00319.01
8.1.20.0070.01418.99
8.1.10.0130.00318.85
8.1.00.0130.01018.81
8.0.300.0130.01017.96
8.0.290.0150.00618.16
8.0.280.0180.00418.11
8.0.270.0120.00918.12
8.0.260.0110.00718.08
8.0.250.0070.01018.14
8.0.240.0120.00918.14
8.0.230.0070.01018.20
8.0.220.0100.00018.07
8.0.210.0150.00618.11
8.0.200.0100.00018.11
8.0.190.0130.00318.21
8.0.180.0050.00518.21
8.0.170.0120.00318.13
8.0.160.0100.01318.11
8.0.150.0070.00318.00
8.0.140.0000.00918.16
8.0.130.0000.00918.05
8.0.120.0090.01217.87
8.0.110.0050.00518.25
8.0.100.0030.00618.14
8.0.90.0150.00618.08
8.0.80.0170.00318.19
8.0.70.0100.00018.13
8.0.60.0060.00318.01
8.0.50.0070.00717.93
8.0.30.0130.01018.14
8.0.20.0140.00418.32
8.0.10.0070.01118.27

preferences:
96.65 ms | 403 KiB | 5 Q