<?php class x { private static self $x; static function getInstance() { // all good return self::$x ??= new self(); } static function getInstance2() { // Not ok : cannot access before initialisation return self::$x = self::$x ?? new self(); } static function getError() { // Not ok : cannot access before initialisation if (!self::$x instanceof self) { self::$x = new self(); } return self::$x; } }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`