====== Costanti Predefinite in PHP ====== * **%%__FILE__%%** -- Percorso completo e nome file del file in cui viene chiamata. * **%%__DIR__%%** -- Directory del file in cui viene chiamata. * **%%__FUNCTION__%%** -- Nome della funzione. * **%%__CLASS__%%** -- Nome della classe. * **%%__METHOD__%%** -- Nome del metodo della classe. * **%%__LINE__%%** -- Attuale numero di riga nel file. * **%%__NAMESPACE__%%** -- Nome dell'attuale namespace **ESEMPIO:** printClassName(); // This prints method name and used namespace $test_magic_constants->printMethodName(); // This prints function name inside class and used namespace // same as method name, but without class $test_magic_constants->printFunction(); // This prints namespace name (works only with PHP 5.3) $test_magic_constants->printNamespace(); ?> **OUTPUT:** This file full path and file name is '/tmp/magic_constants/magic.php'. This file full path is '/tmp/magic_constants'. This is line number 13. This is from 'TestProject\test_function_magic_constant' function. This is TestProject\TestMagicConstants class. This is TestProject\TestMagicConstants::printMethodName method. This is function 'printFunction' inside class. Namespace name is 'TestProject'.