Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("c.php");
- /*
- // From C.php
- class C
- {
- private $cVar;
- __construct(){
- }
- public function method()
- {
- echo "some text";
- }
- }
- */
- class A
- {
- protected $var1; // C Object
- public function __construct()
- {
- $this->var1 = new C();
- }
- function methodA()
- {
- $this->var1->method();
- }
- }
- class B extends A
- {
- public function __contruct(){
- }
- }
- $var = new B();
- $var->methodA();
- //Fatal error: Call to a member function method() on a non-object...
- ?>
Add Comment
Please, Sign In to add comment