3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private $events; private function loopView() { $this->events = ['an event', 'another']; } public function print() { self::loopView(); return function() { foreach ($this->events as $event) echo "$event\n"; }; } } $example = new Example; $eventPrinter = $example->print(); $eventPrinter();

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
150.72 ms | 2293 KiB | 8 Q