<?php class P { protected static $v = 1; public function output() { echo new ReflectionProperty($this, 'v')->getValue($this); } } class C extends P { public function test(P $i) { return $i->v; } } class C2 extends P { protected static $v = 2; } $c = new C; $c2 = new C2; $reflection = new ReflectionClass(P::class); $property = $reflection->getProperty('v'); echo $property->getValue($c2); echo new ReflectionProperty(P::class, 'v')->getValue($c2); $c2->output();
You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).