note 126841 added to function.get-included-files
| From: | AurelienMarchand at main dot php dot net | Date: | Fri, 11 Feb 2022 16:23:31 +0000 |
| Subject: | note 126841 added to function.get-included-files | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217597@lists.php.net to get a copy of this message | ||
This is a great way to emulate Python's '__name__ = "__main__"'
<?php
if(get_included_files()[0] === __FILE__) doStuff();
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 184.146.189.82)
----
Manual Page -- https://php.net/manual/en/function.get-included-files.php
Edit -- https://main.php.net/note/edit/126841
Del: integrated -- https://main.php.net/note/delete/126841/integrated
Del: useless -- https://main.php.net/note/delete/126841/useless
Del: bad code -- https://main.php.net/note/delete/126841/bad+code
Del: spam -- https://main.php.net/note/delete/126841/spam
Del: non-english -- https://main.php.net/note/delete/126841/non-english
Del: in docs -- https://main.php.net/note/delete/126841/in+docs
Del: other reasons-- https://main.php.net/note/delete/126841
Reject -- https://main.php.net/note/reject/126841
Search -- https://main.php.net/manage/user-notes.php