You are here: Re: PHP 4: does method_exist return true if parent class method even if child class forgot to call parent:: « PHP Programming Language « IT news, forums, messages
Re: PHP 4: does method_exist return true if parent class method even if child class forgot to call parent::

Posted by Jacob Atzen on 05/28/05 17:13

On 2005-05-28, lkrubner@geocities.com <lkrubner@geocities.com> wrote:
> The method is in the parent class yet I'd forgotten to call parent::
> in the constructor of the child class. It seems to me that
> method_exists was testing true, though the method was not truly
> available, and then the code died. Adding parent:: to the constructor
> of the child solved the problem. Is this a bug in PHP?

You shouldn't have to call the parent class to get access to its
methods. If class B extends class A then all methods of class A is
available in class B.

--
Cheers,
- Jacob Atzen

 

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

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