eval.in

Paste #3564

PHP — PHP 5.4.6, pasted 1 year ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?php

class MyClass1 {

    public function init(){
        echo 'MyClass1';
    }
}

class MyClass2 extends MyClass1 {

    public function init($params) {
       echo 'MyClass2';
    }
}

$myinstance = new MyClass2();

$myinstance->init('hello');

Program Output

MyClass2

OK (0.004 sec real, 0.005 sec wall, 13 MB, 44 syscalls)

Fork