object(stdClass)#1 (3) { [0]=> string(5) "Volvo" [1]=> string(3) "BMW" [2]=> string(6) "Toyota" } object(stdClass)#2 (3) { ["Peter"]=> string(2) "35" ["Ben"]=> string(2) "37" ["Joe"]=> string(2) "43" }
索引陣列將轉換為物件,其中索引號作為屬性名,值為屬性值。
關聯陣列將轉換為物件,其中鍵作為屬性名,值為屬性值。