使用しているphpのバージョンによって異なります。使用しているバージョンが PHP5 以上の場合 (最新の php バージョンは、ゲーム アプリのパフォーマンスが向上することを意味します)、配列とオブジェクトの両方を使用すると、アプリケーションでほぼ同じパフォーマンスが得られます。したがって、PHP 5 以降を使用している/使用できる場合は、都合に応じて配列またはオブジェクトを使用できます。
Aron Novak によるこの配列とオブジェクトの比較/テストを確認してください: http://aggregation.novaak.net/?q=node/227。私はそれをアーロン・ノヴァクスの言葉で次のように引用しています。
I created a small script to find out which data structure has better performance. You can find the script what I used for the test at the attachments.
My test results are:
data structure PHP4 PHP5
object 61.6224 37.576
array 57.6644 37.866
The results are in milliseconds(ms). It seems that in PHP5 the data structure is totally indifferent, in PHP4 there is approximately 7% performance gain if use arrays instead of objects.
"This revolution, however, left PHP's object model mostly unchanged from version 3 – it was still very simple. Objects were still very much syntactic sugar for associative arrays, and didn't offer users too many features on top of that." (http://devzone.zend.com/node/view/id/1717)
So the syntactic sugar is not a bad thing at all :) And it costs almost nothing. This is an explanation why all the parsers' output uses objects.
このhttp://we-love-php.blogspot.com/2012/06/php-memory-consumption-with-arrays.htmlをチェックして、 PHP 配列とオブジェクトのメモリ使用量とパフォーマンスに関する詳細で優れた記事を確認してください。