PHP data types and magic constants

little bottle
Release: 2023-04-05 21:18:02
forward
2550 people have browsed it

1.

1.boolean Boolean type

(Boolean value itself, integer type 0, floating point type 0.0, empty string, array not containing any elements, not including any Object of member variable

NULL, unassigned variable)

2.integer integer type

3.float floating point type

4.string character String

5.Array array

6.Object object

7.Resource resource type

Special for opening files, database connections, graphics canvas areas, etc. Handle

8.NULL

9.callback Callback type

2.

__LINE__The current line number in the file

__FILE_ _The full path and file name of the file

__DIR__The directory where the file is located

__FUNCTION__Returns the name when the function was defined (case-sensitive)

__CLASS__Returns the The name of the class when it was defined (case-sensitive)

_TRAIT__ returns the name of the trait when it was defined (case-sensitive). The Trait name includes the scope in which it is declared (e.g. Foo\Bar)

__METHOD__ Returns the name of the method when it was defined (case-sensitive)

__NAMESPACE__ The name of the current namespace (case sensitive)

[Recommended course: PHP video tutorial]

The above is the detailed content of PHP data types and magic constants. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template