Best way to initialize (empty) array in PHP

前端 未结 8 1632
悲&欢浪女
悲&欢浪女 2020-12-02 05:25

In certain other languages (AS3 for example), it has been noted that initializing a new array is faster if done like this var foo = [] rather than var foo

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 05:52

    There is no other way, so this is the best.

    Edit: This answer is not valid since PHP 5.4 and higher.

提交回复
热议问题