3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php constant('__DIR__'); define('__DIR__', 'yay'); var_dump(__DIR__);
Output for 5.3.0 - 7.1.0
Warning: constant(): Couldn't find constant __DIR__ in /in/f2oC6 on line 3 string(3) "/in"
Output for 4.3.2 - 5.2.17
Warning: constant(): Couldn't find constant __DIR__ in /in/f2oC6 on line 3 string(3) "yay"
Output for 4.3.0 - 4.3.1
Warning: constant() [http://www.php.net/function.constant]: Couldn't find constant __DIR__ in /in/f2oC6 on line 3 string(3) "yay"