What are the common low-level errors in PHP programming?

Source: Internet
Author: User

Reply content:

    • Isset
$a = null;var_dump(isset($a)); //false
When money is involved, a floating-point number is used to calculate, and then the monthly settlement will find that there will be a few dollars deviation, but the reconciliation is not found problems.

In fact, you should use integer to deal with.

Update, originally can use Bcmath library to solve this problem specifically, recommend https:// packagist.org/packages/ Webit/bcmath It's my fault I'm typing too fast ...
$result = $this->select();return $reuslt;
Re-build the wheel. For example, PHP provides functions to implement a function, but because they do not know, so they wrote a function to achieve the same function, not only waste time and increase the complexity of the code.
    1. PlainText Access User password
    2. Hard-coded and version-controlled password for background system
    3. Non-encrypted cookies
    4. "SELECT * from Users where id= ' {$_get[' uid ']} '"
    5. Self-DDoS yourself foreach ($uids as $uid) {$service =: Connect ...; $service ...}
    6. if (condition met) {...} no else, two months after discovery of mystery bug
    7. If stream, if () {if () {if () {...}} if () {}}, do not reverse-determine the simplified code
    8. Half a day in a view logic output a small piece of HTML
    9. Easy to design class for the transfer of parameters
    10. Use the SESSION as a NoSQL database, $_session["POST" [' title '] = ....
    11. $data stream, $data =. If (..) $data, $data, $data ... Yi $data
    12. To use class as a namespace, method is to set the function of class.
    13. This $a->b[' C ' [' d '] [' e '] ... You don't have to isset.
    14. Using Base64 as an encryption algorithm
    15. Throw exception but lazy catch so that the error message appears in the HTTP response to let the user catch
I'm here without a semicolon, and I've come to this problem firsthand.
Once gave the customer a template, the error of this template let me speechless
Paste Code

   Echo "\r\n\t\t\r\n\t\r\n\t\r\n\t";if ( $sourceurl != "-1" && $sourceurl != "" && $sourceurl != "0" && strstr( $sourceurl, "/" ) ){$SOURCEARR = Explode( "/", $sourceurl );$sourcename = $SOURCEARR[1];$sourcefolder = $SOURCEARR[0];Echo "\ t\"SetSource\"class=\"Pluszone\"> ";Echo $strPlusZone 4;Echo "\r\n\t\"S_setsource\"class=\"Pluszonex\">\r\n\t\"Sourcezone\">\r\n\t\r\n\t";Echo "
       
        ;
        Echo 
        "Cript>
        \r\n\t\$
        (document). Ready (function () {\ r
        \n\t\t\$
        (). Getpicsource ();
        \r\n\t
        });
        \r\n\t
        
        \r\n\t
        "
        ;
        }
        Echo 
        "
        \ t
        \"SourceName\"type=\"Hidden\"id=\"SourceName\"value=\"";Echo $sourcename;Echo "\"size=\" *\"/>\r\n\t\" Sourcefolder \" type= \" Hidden \" id= \" Sourcefolder \" value= \" " ; Echo $sourcefolder ;
       
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.