3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Station { public $platform = null; public function start() { $this->platform = new Platform(); $this->platform->ConfigurePlatform('test'); } public function getOrders() { return $this->platform->GetOrdersFromPlatform(); } } class Platform { private $orders = null; public function ConfigurePlatform($string) { $this->orders = $string; return $this; } public function GetOrdersFromPlatform() { return $this->orders; } } $test = new Station(); $test->start(); echo $test->platform->GetOrdersFromPlatform(); //or echo $test->getOrders();
Output for 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
testtest

preferences:
96.69 ms | 1418 KiB | 4 Q