3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CurrentOrder { static $orderID = 0; public static function get() { $order = new CurrentOrder; self::$orderID = 'hot dogs'; //$order->orderID = 'pizza'; return $order; } public function getOrderID() { return $this->orderID; } } $order = CurrentOrder::get(); var_dump($order->getOrderID());

preferences:
60.03 ms | 402 KiB | 5 Q