3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('content-type: text/plain'); var_dump( 'Current directory: ' . __DIR__, 'Parent directory: ' . dirname(__DIR__), 'Parent of parent directory: ' . dirname(dirname(__DIR__)) );
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(22) "Current directory: /in" string(19) "Parent directory: /" string(29) "Parent of parent directory: /"
Output for 4.3.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/duidu on line 5 Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/duidu on line 6 Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/duidu on line 7 string(26) "Current directory: __DIR__" string(19) "Parent directory: ." string(29) "Parent of parent directory: ."