dodgepudding / wechat-php-sdk

微信公众平台php开发包, weixin developer SDK.
4.44k stars 2.33k forks source link

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

Open pkkgu opened 8 years ago

pkkgu commented 8 years ago

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

nfer commented 8 years ago

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 = [];的方式声明一个空的数组也是可以的。

pkkgu commented 8 years ago

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

nfer commented 8 years ago

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