Re: unset a function?

From: Date: Wed, 30 Jan 2002 21:18:03 +0000
Subject: Re: unset a function?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-82822@lists.php.net to get a copy of this message
In article <Pine.BSF.4.10.10201302054330.27254-100000@localhost>, philip@cornado.com (Philip Olson) wrote: > > <? > > include("file1"); > > function_somename(); > > include("file2"); > > function_somename(); > > ?> > > > > file1 and contain a function definition, but the function in both files had > > the same name. This will give "Cannot redeclare ....". So can i unset the > > function before the second include? > > This sounds like a job for include_once > > > > www.php.net/include_once No, this isn't a case of function being re-declared when the same file gets included a second time, it's two separate files declaring two separate functions which happen to have the same name. Give the functions unique names. -- CC

« previous php.general (#82822) next »