<?php class P { protected $v = 1; } class C extends P { public function test(P $i) { echo $i->v; } } class C2 extends P { public function __construct() { $this->v = 2; } } $c = new C; $c2 = new C2; $c->test($c2);
You have javascript disabled. You will not be able to edit any code.