upcasting in php5
Hello,
i want to translate this code of java to PHP5: Code:
interface I{ i want to use this this way: Code:
I i=new A(); //here is implicit upcasting thanks in advance. |
If I'm understanding you right, what you want is something like
PHP Code:
|
Hello,
thanks for the replay. i want to do upcasting. in java or c++ if class A inherits from class B this statement is true: B b= new A(); i do not know how to do it in PHP. |
PHP is dynamically typed, so you don't have to declare that it is a B even though you're creating an A, just simply create the A
PHP Code:
|
Ok thank you so much.
cheers. |
All times are GMT -5. The time now is 06:56 PM. |