Re: [PHP] loading classes and efficiency

2003-09-13 Thread Brad Pauly
On Sat, 2003-09-13 at 11:08, Curt Zirzow wrote: > * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > > > function &create_object() { > > > [..] > > > } > > > > > > $some_object =& create_object('some_object'); > > > > > This line should be: > $some_object = create_object('some_object'); >

Re: [PHP] loading classes and efficiency

2003-09-13 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > > function &create_object() { > > [..] > > } > > > > $some_object =& create_object('some_object'); > > This line should be: $some_object = create_object('some_object'); The use of & at calltime is deprecated and should only be used in th

RE: [PHP] loading classes and efficiency

2003-09-11 Thread Dan Anderson
> woah u kiddin me ? i'm sure i edited a function in a functions file which > wasnt executed and it still got parsed (spat out errors) Well connecting to a database, etc. does take overhead above and beyond a function. So yes, it does save resources to include it. And I am not completely sure of

RE: [PHP] loading classes and efficiency

2003-09-11 Thread daniel
will never be parsed (and resources used). woah u kiddin me ? i'm sure i edited a function in a functions file which wasnt executed and it still got parsed (spat out errors) that would be a kool resource saver if it did though -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vi

RE: [PHP] loading classes and efficiency

2003-09-11 Thread Dan Anderson
> The way I understand it (maybe you know something I don't?) > require/include_once only prevent an included file from being included > MORE than one time, hence the character string _once tacked onto the end > of include() and require(). > > It does NOT however include a file only when it's need

RE: [PHP] loading classes and efficiency

2003-09-11 Thread daniel
thats how i saw it includes it once so it prevents say functions being reincluded > Dan Anderson >on Wednesday, September 10, 2003 5:44 PM said: > >> require_once() or include_once() >> >> The files containing the class files before you need them. They will >> only

RE: [PHP] loading classes and efficiency

2003-09-11 Thread Chris W. Parker
Dan Anderson on Wednesday, September 10, 2003 5:44 PM said: > require_once() or include_once() > > The files containing the class files before you need them. They will > only be loaded when needed that way. Not true. www.php.net/require_once The way I understand

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Mike Migurski
>>>This is really funny i've been doing php for a good while now but what >>>is the reason to use the & symbol on the function ? >> >>returns by reference. > >ok i get it but why would i need it in my example ? I think it was a hypothetical thing on Brad's part ... one of the annoying things about

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Mike Migurski
>> $some_object =& create_object('some_object'); >> > >This is really funny i've been doing php for a good while now but what is >the reason to use the & symbol on the function ? returns by reference. - michal migurski- contact i

Re: [PHP] loading classes and efficiency

2003-09-10 Thread daniel
> function &create_object() { > [..] > } > > $some_object =& create_object('some_object'); > This is really funny i've been doing php for a good while now but what is the reason to use the & symbol on the function ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Brad Pauly
On Wed, 2003-09-10 at 18:45, [EMAIL PROTECTED] wrote: > i'mn about to learn some java, maybe swt in the eclipse environment, it > would be nice if php could have the classes or the path precompiled in, so > all you need to do is load the object ? I think in php5 there will be a mechanism to handle

Re: [PHP] loading classes and efficiency

2003-09-10 Thread daniel
i'mn about to learn some java, maybe swt in the eclipse environment, it would be nice if php could have the classes or the path precompiled in, so all you need to do is load the object ? > woah > > function create_object($class_path,$class_name) { > include("".$class_path."/".$class_name.".php

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Dan Anderson
> Hi there i was wondering is it more efficient to load class files and > objects when needed per page or is it ok to include them in my main include > file ? require_once() or include_once() The files containing the class files before you need them. They will only be loaded when needed that way

Re: [PHP] loading classes and efficiency

2003-09-10 Thread daniel
woah function create_object($class_path,$class_name) { include("".$class_path."/".$class_name.".php"); return new $class_name; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] loading classes and efficiency

2003-09-10 Thread daniel
> $foo_object = CreateObject('FooObject'); :D How would it look you reckon ? function CreateObject($class) { include('$class.".php"'); return new $class; } ?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] loading classes and efficiency

2003-09-10 Thread Brad Pauly
On Wed, 2003-09-10 at 17:58, [EMAIL PROTECTED] wrote: > Hi there i was wondering is it more efficient to load class files and > objects when needed per page or is it ok to include them in my main include > file ? It might be fine. If the class files are not that large, there might not be much diff

[PHP] loading classes and efficiency

2003-09-10 Thread daniel
Hi there i was wondering is it more efficient to load class files and objects when needed per page or is it ok to include them in my main include file ? I dont this for specialised classes for a few pages but other globally used classes i include in a main include file. Let me know thanks. -- P