public static or static public

在 php 中,public static 或 static public 怎么写都可以,所以我一直不知道哪种是正统的写法(象我这样追求正统的人,或许 python 更适合我?)。

今天费点时间看看别人是怎么看待 public static or static public 这个问题的。我的结论是 public static 是正统的写法,于是我想把以前随意写成的 static public 都更新成 public static。所幸的是,以前一直用的都是 public static。倒是在 magento 的源码里找到一堆 static public,或许 magento developers 没被要求一定要怎么写,所以源码里混合了 public static 和 static public。

我觉得 inconsistency 是最糟糕的,或许我在这个问题上吹毛求疵了。

Related Posts

Leave a comment

Your email address will not be published. Required fields are marked *