3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractEvent { protected $id; private $hidden; } final class Event extends AbstractEvent implements JsonSerializable { private $value; public function __construct() { $this->id = 5; $this->value = 'abc'; } public function jsonSerialize() { return get_object_vars($this); } } $e = new Event(); echo json_encode($e);

preferences:
50.77 ms | 402 KiB | 5 Q