Posted by Schraalhans Keukenmeester on 10/02/05 15:36
joes wrote:
> Hello
>
> I am a php newbie... I like to overload a function in php (as like in
> other oo languages). I didn't get this working. Is an overaloding in
> php not possible? What is about the funtion "overlaod()" in php would
> this be the trick?
>
>
> class Base
> {
> function test()
> {}
>
> function test($param1)
> {}
> }
>
>
> This would end in the error:
>
> "Fatal error: Cannot redeclare Base: test() in Base.php ..."
>
> Thanks in advance for any comments
> regards
> Mark Egloff
>
Overloading as available in strongly typed languages as C++/C# isn't
available in PHP (AFAIK). You can overload __get , __set and __call in
PHP5. Look at http://php.net/overload for details.
Sh
Navigation:
[Reply to this message]
|