List Info

Thread: note 77465 added to function.include




note 77465 added to function.include
user name
2007-08-30 12:37:40
With a large system you might have lots of functions. I have
noticed that this can produce large memory overhead, some of
which can be alleviated by using includes in the following
manner:

e.g.
<?php
function foo() {
  //some long block of code here producing $bar
  return $bar;
}
?>

can be rewritten as:
<?php
function foo() {
  return include "foo.php";
}
?>

where foo.php contains the following:
<?php
//long block of code producing $bar
return $bar;
?>

The result is the function's body does not get loaded into
memory until the function is actually called.
----
Server IP: 69.147.83.197
Probable Submitter: 71.189.57.4
----
Manual Page -- htt
p://www.php.net/manual/en/function.include.php
Edit        -- https://master
.php.net/note/edit/77465
Del: integrated  -- h
ttps://master.php.net/note/delete/77465/integrated
Del: useless     -- http
s://master.php.net/note/delete/77465/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/77465/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/77465/spam
Del: non-english -- 
https://master.php.net/note/delete/77465/non-english
Del: in docs     -- http
s://master.php.net/note/delete/77465/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/77465
Reject      -- https://mast
er.php.net/note/reject/77465
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )