3v4l.org

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

preferences:
41.87 ms | 402 KiB | 5 Q