<?php
class A {
// Public Constructor ...
// No Problems Here.
public function __construct( ) {
}
// Class Function.
public function functionA( ) {
}
}
class B extends A {
// Public Constructor ...
// Same As Parent Class ...
// Again No Problems Here.
public function __construct( ) {
}
// Class Function.
public function functionB( ) {
}
}
class C extends A {
// Private Constructor ...
// Weaker Then Parent Class ...
// PHP Will Throw A Fatal Error.
private function __construct( ) {
}
// Class Function.
public function functionC( ) {
}
}
Fatal error: Access level to C::__construct() must be public (as in class A) in /in/Ff3QS on line 50
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/Ff3QS 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/Ff3QS 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/Ff3QS on line 7
Process exited with code 255.