InterviewSolution
| 1. |
What Happen, If Constructor Is Defined As Private Or Protected? |
|
Answer» If constructor DECLARED as private, PHP through the following FATAL error when CREATE object. Fatal error: Call to private BaseClass::__construct() from invalid context in. If constructor declared as private, PHP through the following fatal error when create object. Fatal error: Call to protected BaseClass::__construct() from invalid context in. If constructor declared as private, PHP through the following fatal error when create object. Fatal error: Call to private BaseClass::__construct() from invalid context in. If constructor declared as private, PHP through the following fatal error when create object. Fatal error: Call to protected BaseClass::__construct() from invalid context in. |
|