<?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__);
magic __DIR__ is not defined; defining it now.
string(3) "/in"
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
<br />
<b>Notice</b>: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in <b>/in/jvHH3</b> on line <b>5</b><br />
magic __DIR__ is not defined; defining it now.PHP_EOLstring(3) "/in"