Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
PHP
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Data types === PHP is [[strong and weak typing|loosely typed]]. It stores integers in a platform-dependent range, either as a 32, 64 or 128-bit [[signed number representations|signed]] [[integer (computer science)|integer]] equivalent to the [[C variable types and declarations|C-language long type]]. Unsigned integers are converted to signed values in certain situations, which is different behaviour to many other programming languages.<ref>{{cite web | url = http://www.mysqlperformanceblog.com/2007/03/27/integers-in-php-running-with-scissors-and-portability/ | title = Integers in PHP, running with scissors, and portability | date = March 27, 2007 | publisher = MySQL Performance Blog | access-date = 2007-03-28}}</ref> Integer variables can be assigned using decimal (positive and negative), [[octal]], [[hexadecimal]], and [[binary code|binary]] notations.{{Citation needed|date=November 2023}} [[Floating-point number]]s are also stored in a platform-specific range. They can be specified using floating-point notation, or two forms of [[scientific notation]].<ref name="The PHP Group-2">{{cite web|access-date=2008-03-16|url=https://www.php.net/manual/en/language.types.php|title=Types |publisher=The PHP Group}}</ref> PHP has a native [[Boolean data type|Boolean]] type that is similar to the native Boolean types in [[Java (programming language)|Java]] and [[C++]]. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in [[Perl]] and C++.<ref name="The PHP Group-2" /> The null data type represents a variable that has no value; <code>NULL</code> is the only allowed value for this data type.<ref name="The PHP Group-2" /> Variables of the "resource" type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources.<ref name="The PHP Group-2" /> Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in [[hash table|hashes]] with both keys and values, and the two can be intermingled.<ref name="The PHP Group-2" /> PHP also supports [[string (computing)|strings]], which can be used with single quotes, double quotes, nowdoc or [[heredoc]] syntax.<ref>{{cite web|access-date=2008-03-21|url=https://www.php.net/manual/en/language.types.string.php|title=Strings |publisher=The PHP Group}}</ref> The '''Standard PHP Library''' (SPL) attempts to solve standard problems and implements efficient data access interfaces and classes.<ref>{{cite web | url = https://www.php.net/spl | title = SPL β StandardPHPLibrary | date = March 16, 2009 | website = PHP.net | access-date = 2009-03-16}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
PHP
(section)
Add topic