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.使用記錄很容易調試您的代碼。