wechat-php-sdk icon indicating copy to clipboard operation
wechat-php-sdk copied to clipboard

几个订单方法 声明数组有问题 $data = [];

Open pkkgu opened this issue 9 years ago • 3 comments

@nfer 几个订单方法 声明数组有问题 $data = [];

pkkgu avatar Jan 14 '16 16:01 pkkgu

http://php.net/manual/en/language.types.array.php

As of PHP 5.4 you can also use the short array syntax, which replaces array() with [].

http://stackoverflow.com/questions/5966746/best-way-to-initialize-empty-array-in-php

In ECMAScript implementations (for instance, ActionScript or JavaScript), Array() is a constructor function and [] is part of the array literal grammar. Both are optimized and executed in completely different ways, with the literal grammar not being dogged by the overhead of calling a function.

从上面两处来看,$data = [];的方式声明一个空的数组也是可以的。

nfer avatar Jan 15 '16 03:01 nfer

国内生产服务器 PHP5.3还是有N多的

pkkgu avatar Jan 15 '16 03:01 pkkgu

抱歉,我考虑不周。你提一个pull request吧

nfer avatar Jan 15 '16 03:01 nfer