Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the common PHP system constants?

Shulou Source: shulou.com Published: 2022-06-03 04:22:44 10月01日 Update

This article introduces what the commonly used PHP system constants are, the content is very detailed, interested friends can refer to, hope to be helpful to you.

There are many things we need to learn deeply in the PHP language, and we should constantly update our knowledge base to make up for the deficiencies. PHP defines some system information and mathematical constants as system constants. These PHP system constants can be used at any time in the program, but the values of these constants cannot be changed. The system constant does not have a "$" symbol and is usually capitalized. Here are some common PHP system constants:

_ _ FILE__ current PHP file name

_ _ LINE__ the number of lines in the current PHP file

_ _ the function currently executed by FUNCTION__

_ _ the class currently executed by CLASS__

The version of PHP_VERSION PHP

PHP_OS operating system of the current server

TRUE is the same as true

FALSE is the same as false

E_ERROR to the most recent error

E_WARNING to the most recent warning

There are errors in E_PARSE syntax.

There are anomalies in E_NOTICE PHP language

M__PI pi

Scientific constant e

The logarithm of e of M__LOG2E with base 2

Logarithm of M_LOG10E with base 10

Natural logarithm of M_LN2 2

Natural logarithm of M_LN10 10

On the commonly used PHP system constants have anything to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: System constant logarithm common use content constant file more knowledge nature language error antecedent help yes operating system thing information interest function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno MySQL Xiaomi NVidia