Three lessons I learned the hard way while developing a PHP based product, 3教训,我学到的努力的方式,而发展中国家的一个PHP基于产品, Translator Plugin Pro for WordPress翻译插件亲为的WordPress . Let me know if you find them useful.让我知道,如果你发现他们有用的。

1. 1 。 PHP is no Java. PHP是没有的Java 。
I don’t intend to be sarcastic.我不打算予以讽刺。 In reality I sorely miss the comfort of Java in more ways than one.在严峻的现实i小姐舒适的Java在更多的办法比1 。
PHP lacks several built-in checks of Java to ensure defect free coding; features like strong typing, checked exceptions (by default), and lack of variant types (variable which can take on any data types). PHP中缺乏的几个内置在Java的检查,以确保缺陷免费编码;强大的功能,如打字,检查例外(默认情况下) ,以及缺乏变异类型(变量可以采取对任何数据类型) 。 So you have to be extra careful in PHP to write high quality code.因此,你必须格外小心在PHP写高质量的代码。 Also PHP is not as platform independent as Java.此外, PHP是不作为平台,作为独立的Java 。 What I mean is that PHP has several platform dependent capabilities or lack thereof which makes it harder to make it work across platforms.我的意思是, PHP中有几个平台供养能力或缺乏这使得加倍努力,使它的工作,跨平台。

2. 2 。 You best friend for PHP development is:你最好的朋友, PHP的发展是:
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); error_reporting ( e_error | e_warning | e_parse | e_notice ) ;

This little piece of code thrown in at the top of your file is arguably the best PHP debugging tool you can find.这个小小的一段代码扔在在上方的将您的档案可以说是最好的PHP调试工具,您可以找到。 All your errors, warnings and even notices are displayed on your browser for you to correct.您的所有错误,警告,甚至告示显示在您的浏览器为您正确的。

3. 3 。 Use file based logging instead of logging on browser.使用档案记录,而是基于测井对浏览器。 Logging on browser messes up your page layout and can even cause additional problems thereby obscuring your true defect.测井对浏览器的餐厅您的页面布局,甚至可以造成额外的问题,从而模糊了您的真实缺陷。 The best and unobtrusive way to log is to a file.最好的和张扬的方式登录,是到一个文件。 You can try my technique for simple您可以尝试我的技术很简单 php logging PHP的测井 . Use logging for easy debugging of your code.使用记录很容易调试您的代码。