<?php
/***
* This works in PHP5 but does not anymore in PHP6
*/
class Parnt {
public function foo() {}
}
class Child extends Parnt {
public function foo($arg){}
}
/***
* Those don't work in either 5 or 6
*/
interface Inter {
public function foo();
}
class Child3 implements Inter {
public function foo($arg){}
}
abstract class Abst {
abstract public function foo();
}
class Child2 extends Abst {
public function foo($arg){}
}
Strict Standards: Declaration of Child::foo() should be compatible with Parnt::foo() in /in/eamAR on line 11
Fatal error: Declaration of Child2::foo() must be compatible with Abst::foo() in /in/eamAR on line 28
Process exited with code 255.
Strict Standards: Declaration of Child::foo() should be compatible with that of Parnt::foo() in /in/eamAR on line 11
Fatal error: Declaration of Child2::foo() must be compatible with that of Abst::foo() in /in/eamAR on line 28
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/eamAR on line 7
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/eamAR on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/eamAR on line 7
Process exited with code 255.