3v4l.org

run code in 300+ PHP versions simultaneously
<?php function lfi_be_gone($userProvided, $basePath) { $real = realpath($userProvided); if ($real === false) { throw new Exception('LOL NOPE'); } if (strpos($real, $basePath) !== 0) { throw new Exception('LOL NOPE'); } return $real; } # Usage: $userProvidedVariable = '../../../../../../../../etc/passwd'; require_once lfi_be_gone("includes/" . $userProvidedVariable, $_SERVER['DOCUMENT_ROOT'] . '/includes/');
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Exception: LOL NOPE in /in/UFqfm:7 Stack trace: #0 /in/UFqfm(21): lfi_be_gone('includes/../../...', '/includes/') #1 {main} thrown in /in/UFqfm on line 7
Process exited with code 255.

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:
52.56 ms | 401 KiB | 8 Q