3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); if (!defined('__DIR__')) { echo 'magic __DIR__ is not defined; defining it now.' . PHP_EOL; define('__DIR__', dirname(__FILE__)); } var_dump(__DIR__);
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
magic __DIR__ is not defined; defining it now. string(3) "/in"
Output for 4.3.1 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/7Oibm on line 5 magic __DIR__ is not defined; defining it now.PHP_EOLstring(3) "/in"
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/jvHH3 on line 5 magic __DIR__ is not defined; defining it now.PHP_EOLstring(3) "/in"