3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { public static function doIt() { printf( "Line: %s\n File: %s\n Dir: %s\n Function: %s\n Class: %s\n Trait: %s\n Method: %s\n Namespace: %s\n", __LINE__, __FILE__, __DIR__, __FUNCTION__, __CLASS__, __TRAIT__, __METHOD__, __NAMESPACE__); } } x::doIt();
Output for 5.4.0 - 7.1.0
Line: 14 File: /in/amWeq Dir: /in Function: doIt Class: x Trait: Method: x::doIt Namespace:
Output for 5.3.0 - 5.3.29
Notice: Use of undefined constant __TRAIT__ - assumed '__TRAIT__' in /in/amWeq on line 14 Line: 14 File: /in/amWeq Dir: /in Function: doIt Class: x Trait: __TRAIT__ Method: x::doIt Namespace:
Output for 5.0.0 - 5.2.17
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /in/amWeq on line 14 Notice: Use of undefined constant __TRAIT__ - assumed '__TRAIT__' in /in/amWeq on line 14 Notice: Use of undefined constant __NAMESPACE__ - assumed '__NAMESPACE__' in /in/amWeq on line 14 Line: 14 File: /in/amWeq Dir: __DIR__ Function: doIt Class: x Trait: __TRAIT__ Method: x::doIt Namespace: __NAMESPACE__
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/amWeq on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/amWeq on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/amWeq on line 4
Process exited with code 255.