3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = '/some/dir'; $path = '/foo/bar'; $protect = array('/a','/foo','/bob'); foreach($protect as $needle) { echo "Checking for $needle in $path:\n"; if( strpos($path,$needle) !==FALSE ) { echo "path contains the needle"; if( strcmp( $path, $needle ) > 0 ) { echo "The path is a subfolder inside the needle"; } else { echo "The path isn't a subfolder inside the needle"; } } else { echo "The path doesn't contain the needle"; } echo "\n\n"; } echo "Check completed"; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Checking for /a in /foo/bar: The path doesn't contain the needle Checking for /foo in /foo/bar: path contains the needleThe path is a subfolder inside the needle Checking for /bob in /foo/bar: The path doesn't contain the needle Check completed

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.42 ms | 401 KiB | 8 Q