Php explains why isset () is used ()

Source: Internet
Author: User
Tags php error reporting
Php explains why isset () is used () by default, the PHP error reporting level is not the highest, which leads to some small errors, but we cannot see the errors. according to the practice, it is found that these small errors will affect the PHP execution speed and execution speed! @ Suppress error. it does not mean that no error is generated. error_reporting (8191) starts. # explain the error in php to why isset () is used ()
The PHP error reporting level is not the highest by default.
This will cause some minor errors, but we will not see them.
According to the practice, it is found that PHP's small errors will affect the PHP's high execution speed and high execution speed!
@ Suppress error. no error is generated.

Start

Error_reporting (8191); # adjust the error reporting level to the highest

Echo $ a; # an error occurs. $ a is not defined in advance.

Echo @ $ a; # Nothing

Finally, the speed test on isset and @ found that after the execution of 1000 times

Isset Time: 0.0008 ± 0. 0001 seconds
@ Takes 0.002 seconds


If no reason is found, the default error level is directly set.

If ($ a) loops for 1 million times
And
If (isset ($ a) loops for 1 million times

It's not a little faster

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.