note 74060 added to function.include-once
| From: | leahcim at pythontech dot net dot au | Date: | Thu, 22 Mar 2007 11:07:20 +0000 |
| Subject: | note 74060 added to function.include-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124705@lists.php.net to get a copy of this message | ||
in reply to: tszming,
I think you mean,
<?php
function my_include_once($path) {
if ( !defined($path) ) {
include($path);
define($path, 1); // instead of defined()
}
}
?>
Secondly,
I don't see how this is any more optimized then PHP's native function. There is reason why
functions exist in PHP's core, please don't re-invent the wheel for no gain in
functionality. It could mis-lead people into falsely using this function.
----
Server IP: 203.16.234.91
Probable Submitter: 121.45.62.140
----
Manual Page -- http://www.php.net/manual/en/function.include-once.php
Edit -- https://master.php.net/note/edit/74060
Del: integrated -- https://master.php.net/note/delete/74060/integrated
Del: useless -- https://master.php.net/note/delete/74060/useless
Del: bad code -- https://master.php.net/note/delete/74060/bad+code
Del: spam -- https://master.php.net/note/delete/74060/spam
Del: non-english -- https://master.php.net/note/delete/74060/non-english
Del: in docs -- https://master.php.net/note/delete/74060/in+docs
Del: other reasons-- https://master.php.net/note/delete/74060
Reject -- https://master.php.net/note/reject/74060
Search -- https://master.php.net/manage/user-notes.php