You are here: Re: Q: static method working in PHP4 and PHP5 « PHP « IT news, forums, messages
Re: Q: static method working in PHP4 and PHP5

Posted by M. Sokolewicz on 03/24/05 15:26

Piotr Klaban wrote:
> Hi,
>
> An example script:
>
> <?php
> error_reporting(4095);
> class Foo {
> function test() {
> }
> }
> Foo::test();
> ?>
>
> would produce in PHP5 error:
> PHP Strict Standards: Non-static method Foo::test() should not be called statically in ... line 8
>
> I have two questions:
>
> 1. Could it be possible that under specific circumstances such a call
> can produce fatal error "Non-static method Foo::test() cannot be called statically"?
>
no
> 2. Is there a proper way to write such a class that would work properly in both
> PHP4 and PHP5, without Strict errors?
no, unless you keep this code and turn off E_STRICT error_reporting
>
> Best regards,
>

 

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

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