You are here: Re: [PHP] constructors in PHP « PHP « IT news, forums, messages
Re: [PHP] constructors in PHP

Posted by Greg Donald on 07/11/05 18:04

On 7/11/05, Alessandro Rosa <zandor_zz@yahoo.it> wrote:
> Is there the possibility to have in PHP multiple class constructors
> as in C++ or just one ?

Doesn't seem as though you can:

> cat class.php
#!/usr/bin/php
<?php

error_reporting( E_ALL );

class Foo
{
function __construct()
{

}

function __construct()
{

}
}

$f = new Foo;

?>


> ./class.php
PHP Fatal error: Cannot redeclare __construct() in
/home/greg/class.php on line 13

Fatal error: Cannot redeclare __construct() in /home/greg/class.php on line 13


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

 

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

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