3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = [ 'Stops' => [ ['order_number' => 123, 'whatever' => 'meh'], ['order_number' => 124, 'whatever' => 'meh again'], ] ]; $object = new class() { public $Stops = []; public function __construct() { $this->Stops []= new class() { public $order_number = 123; public $whatever = 'meh'; }; $this->Stops []= new class() { public $order_number = 124; public $whatever = 'meh again'; }; } }; echo json_encode($assoc); echo "\n"; echo json_encode($object);

preferences:
59.84 ms | 402 KiB | 5 Q