3v4l.org

run code in 300+ PHP versions simultaneously
<?php // @see https://git.drupalcode.org/project/canvas/-/blob/c5fd26f0999496f5f1b1d88e06e522a44d3fc85b/src/PathProcessor/CanvasPathProcessor.php function processInbound($path) { // Only rewrite if not /canvas/api and starts with /canvas/ if (str_starts_with($path, '/canvas/') && !str_starts_with($path, '/canvas/api')) { return '/canvas'; } return $path; } $cases = [ '/canvas', '/canvas/foo', '/canvas/api/something', '/canvas/node/42', ]; foreach ($cases as $c) { print sprintf("%s -> %s\n", $c, processInbound($c)); }
Output for git.master_jit, git.master
/canvas -> /canvas /canvas/foo -> /canvas /canvas/api/something -> /canvas/api/something /canvas/node/42 -> /canvas

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:
57.46 ms | 714 KiB | 4 Q