3v4l.org

run code in 300+ PHP versions simultaneously
<?php class T { public $untypedPublic; protected $untypedProtected; private $untypedPrivate; public mixed $typedPublic; protected mixed $typedProtected; private mixed $typedPrivate; public string $hookedGetVirtual { get { return "virtual"; } } public int $hookedGetBacked { get { return $this->untypedPublic + 25; } } } $o = new T; foreach ($o as $prop) { var_dump($prop); } foreach (get_object_vars($o) as $prop) { var_dump($prop); }

preferences:
149.08 ms | 992 KiB | 7 Q