msgbartop
PHP源码分析,Zend引擎分析,Web相关技术研究,Web技术分享–左手代码 右手诗
msgbarbottom

17 Aug 08 PHP的老式语法

因为我的blog使用的wordpress,所以不可避免的看了看wp的源码,发现了一些很老式的语法,呵呵,难到wp的工程师都是老phper了?
if…endif:

if(con):
  expr;
elseif(con):
  expr;
else:
  expr;
endif;

while … endwhile;

while (con):
   ...
endwhile;

还有就是最近遇到了以前遇到过的一个问题, 就是如果自定义的404错误页面大小过小(512字节), IE会认为是不友好的错误页面,从而使用内建的自己的错误页面代替,唉,自作聪明的IE;

Related Posts:

Tags:

Reader's Comments

  1. |

    这种写法其实也是挺好的。相对于

    html

    ,少了{},看起来更舒服,rails中也是这种写法

  2. |

    有点VB的风格。

  3. |

    这种语法在template中更容易阅读,你用花括号对比下就知道

  4. |

    如果用模板的话, 我觉得还是使用heredoc更好一些。
    这样的语法,倒没有什么好坏之分,反正最后都会编译成一样的opcodes。
    个人喜好吧。

  5. |

    我这个虽然说是可以的。但在比配上存在着它的不足。脚本的运用它还是很灵巧的。还是用现在最新的更使用些

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word