Re: Classes code completion and Zend Studio

From: Date: Tue, 15 Mar 2005 01:30:32 +0000
Subject: Re: Classes code completion and Zend Studio
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-210730@lists.php.net to get a copy of this message
On Mon, 14 Mar 2005 23:30:51 +0000, Alister Bulman <abulman@gmail.com> wrote: > On Mon, 14 Mar 2005 19:14:37 +0530, Zareef Ahmed <zareef.ahmed@gmail.com> wrote: > > Hi All, > > > > I have a function to load the classes and return the object. > > > > function LoadClass($ClassName) > > { > > require_once("Class.$ClassName.inc"); > > return new $ClassName(); > > } > > With it being a require, won't it always be loaded, whether > theLoadClass functon is called or not? 'Include/include_once' loads > on demand, but right now thats effectively the same as > require_once("Class.$ClassName.inc"); > function LoadClass($ClassName) { > return new $ClassName(); > } > isn't it? > QUOTE From PHP Documentation at php.net "require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error." "NOTE: This function changed how it worked. In PHP 3 this behaved very differently than it does on PHP 4................................" http://in.php.net/require/ Zareef Ahmed -- Zareef Ahmed :: A PHP Developer in India ( Delhi ) Homepage :: http://www.zareef.net

« previous php.general (#210730) next »