3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php public function make_path2($curr_dir, $path) { $this->error = ""; $result = "/"; if ($path[0] === "/") { $path = substr($path, 1); } else { $path = substr($curr_dir, 1).'/'.$path; } if ($path) { $splitpath=explode("/", $path); foreach ($splitpath as $pathticle) { switch($pathticle) { case ".." : $result = dirname($result); // if second char of $result is not set, then current result is the rootNode if (isset($result[1])) { $result .= "/"; } $result[0] = "/"; // make sure that even under windows, slashes are always forward slashes. break; case "." : break; case "" : break; default: $result .= $pathticle."/"; break; } } } return $result; }
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/rSuAa on line 3
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/rSuAa on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_PUBLIC in /in/rSuAa on line 3
Process exited with code 255.