You are here: Re: Class Redefinition Error « All PHP « IT news, forums, messages
Re: Class Redefinition Error

Posted by Tony Mays on 08/01/05 06:50

JohnJay wrote:

> Hi,
>
use

require_once("...")

> I have a problem. I've got a base class for which two classes spawn
> off (in diff files):
>
> base->class1
> ->class2
>
> The problem I have is if class1 and class2 are used in the same file:
>
> require "class1.php"
> require "class2.php"
>
> If I include the line "require 'class2.php'", I get the following:
>
>
> Fatal error: Cannot redeclare class base in test.php on line 13
>
> I've got the following defns:
>
> abstract class base
> {
> }
>
> require "base.php"
> class class[1/2] extends base
> {
> }
>
> What's the soln? Thx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация