3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Path { public $currentPath; private $array; function __construct($path) { $this->currentPath = $path; $array = explode("/", $path); print_r($array); } public function cd($newPath) { throw new Exception('Not implemented'); } } $path = new Path('/a/b/c/d');

preferences:
31.95 ms | 402 KiB | 5 Q