<?php class A { static protected $count = 0; protected $data = [1,2,3,5]; public function data() { return $this->data; } } class B extends A { protected $data = [5,6,7,89]; public function data() { self::$count++; echo self::$count, "\n"; if (self::$count >= 10) return; return static::data(); } } $b = new B(); var_dump($b->data());
You have javascript disabled. You will not be able to edit any code.