[ create a new paste ] login | about

Link: http://codepad.org/OgdUkRpC    [ raw code | output | fork ]

PHP, pasted on Jun 1:
<?php
 class Animal{
     protected $myVar;
     public function __construct() {
          $this->myVar = 'a';
     }
 }

class Cat extends Animal {
     public function foo() {
         echo $this->myVar;
     }
 }

$cat = new Cat(); 
$cat->foo(); 





?>


Output:
1
a


Create a new paste based on this one


Comments: