3v4l.org

run code in 300+ PHP versions simultaneously
<?php $templateXML = simplexml_load_file( implode( DIRECTORY_SEPARATOR, [JPATH_SITE, 'templates', $this->template->name, 'templateDetails.xml'] ) ); if (!strlen((string) $templateXML->namespace)) { // do something with non-namespaced template }
Output for 8.0.0 - 8.0.13, 8.1rc1 - rc3
Fatal error: Uncaught Error: Undefined constant "JPATH_SITE" in /in/nOMeB:6 Stack trace: #0 {main} thrown in /in/nOMeB on line 6
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.26
Warning: Use of undefined constant JPATH_SITE - assumed 'JPATH_SITE' (this will throw an Error in a future version of PHP) in /in/nOMeB on line 6 Fatal error: Uncaught Error: Using $this when not in object context in /in/nOMeB:6 Stack trace: #0 {main} thrown in /in/nOMeB on line 6
Process exited with code 255.

preferences:
38.21 ms | 461 KiB | 5 Q