3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); class a { private $cache = 5; public function getCache() { return $this->cache; } } class b extends a { private $cache; public function setCache($value) { $this->cache = $value; } } $d = new b(); $d->setCache(2); echo $d->getCache();

preferences:
55.27 ms | 405 KiB | 6 Q