What are common low-level errors in PHP programming? -Php Tutorial

Source: Internet
Author: User
Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply content:
  • Isset

$a = null;var_dump(isset($a)); //false
When money is involved, floating point numbers are used for calculation, and then the deviation of a few dollars is found during monthly settlement, but the reconciliation cannot be found.

In fact, Integer should be used for processing.

Update, originally can use bcmath library to specifically solve this problem, recommended https://packagist.org/packages/webit/bcmath All blame me for typing too fast...

$result = $this->select();return $reuslt;
Repeat the wheel. For example, PHP provides a function to implement a function, but because I don't know it, I wrote another function to implement the same function, which not only wastes time but also increases the complexity of the code.
  1. Plaintext access user password
  2. Password for hardcoded and version-controlled background systems
  3. Unencrypted cookie
  4. "SELECT * FROM users where id = '{_ _ GET ['uid']}'"
  5. Self-DDOS foreach ($ uids as $ uid) {$ service =... connect ...... $ service ...}
  6. If (condition met) {...} no else, a mysterious bug found two months later
  7. If stream, if () {...} if () {}} without reverse judgment to simplify the code
  8. In a view, a short section of html is output logically for half a day.
  9. Design Class for parameter passing convenience
  10. Use SESSION as a NOSQL database, $ _ SESSION ["post"] ['title'] = ....
  11. $ Data stream, $ data =... if (...) $ data, $ data, $ data... all the way $ data
  12. When Class is used as the namespace, method sets the function of Class.
  13. In this way, $ a-> B ['c'] ['D'] ['E ']...
  14. Use base64 as the encryption algorithm
  15. Throw exception, but too lazy to catch, so that the error message appears in the http response to allow the user to catch
I am here without a semicolon. I have personally experienced this problem.
When I used to give the customer a template, the template error left me speechless
Post Code


  \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

";echo $strPlusZone4;echo "

\r\n\t

\r\n\t

\r\n\t

\r\n\t";echo " \r\n\t\$(document).ready(function(){\r\n\t\t\$().getPicSource();\r\n\t});\r\n\t《script》\r\n\t";}echo "\t \r\n\t
Related Article

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.