PHP: Difference between revisions

Content deleted Content added
mNo edit summary
m remove links to mass-deleted portals
Line 1:
{{Short description|server-side scripting language}}
{{About|the scripting language}}
{{Short description|server-side scripting language}}
{{Good article}}
{{Infobox programming language
Line 18:
| typing = [[dynamic typing|Dynamic]], [[weak typing|weak]]
'''since version 7.0:'''
[[ gradual typing|Gradual]]<ref>{{cite web|url=https://secure.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration.strict|title=PHP: Function arguments - Manual|website=secure.php.net}}</ref>
| implementations = [[Zend Engine]], [[HHVM]], [[Phalanger (compiler)|Phalanger]], [[Quercus (software)|Quercus]], [[Parrot virtual machine|Parrot]]
| dialects =
| influenced by = [[Perl]], [[C (programming language)|C]], [[C++]], [[Java (programming language)|Java]], [[Tcl]],<ref name="mysqlconference" />, [[JavaScript]], [[Hack (programming language)|Hack]]<ref name="optimisation ideas">{{cite web | url = https://twitter.com/dstogov/status/672864802474229760 | title = It's not a secret that some.| last = Stogov | first = Dmitry | publisher = Twitter | date = 2015-12-04}}</ref>
| influenced = [[Hack (programming language)|Hack]]
| programming language = [[C (programming language)|C]] (primarily; some components [[C++]])
Line 32:
'''PHP: Hypertext Preprocessor''' (or simply '''PHP''') is a [[general-purpose programming language]] originally designed for [[web development]]. It was originally created by [[Rasmus Lerdorf]] in 1994;<ref name="History of PHP">{{cite web|title=History of PHP|url=http://php.net/manual/en/history.php.php|website=php.net}}</ref> the PHP [[reference implementation]] is now produced by The PHP Group.<ref name="about PHP">{{cite web|access-date=2008-02-25|url=http://www.php.net/history|title=History of PHP and related projects |publisher=The PHP Group}}</ref> PHP originally stood for ''Personal Home Page'',<ref name="History of PHP" /> but it now stands for the [[recursive initialism]] ''PHP: Hypertext Preprocessor''.<ref>[http://php.net/manual/en/preface.php PHP Manual: Preface], www.php.net.</ref>
 
PHP code may be executed with a [[Command-line interface|command line interface]] (CLI), embedded into [[HTML]] code, or used in combination with various [[web template system]]s, web [[content management system]]s, and [[web framework]]s. PHP code is usually processed by a PHP [[interpreter (computing)|interpreter]] implemented as a [[plugin (computing)|module]] in a web server or as a [[Common Gateway Interface]] (CGI) executable. The web server outputs the results of the interpreted and executed PHP code, which may be any type of data, such as generated HTML code or binary image data. PHP can be used for many programming tasks outside of the web context, such as [[Computer software|standalone]] [[graphical user interface|graphical applications]]<ref>{{cite web | url = http://php.net/manual/en/intro-whatcando.php | work = PHP Manual | title = Introduction: What can PHP do? | access-date = 2009-03-05}}</ref> and robotic [[Unmanned aerial vehicle|drone]] control.<ref>{{Citation|title=:helicopter: Port of node-ar-drone which allows user to control a Parrot AR Drone over PHP: jolicode/php-ar-drone|date=2019-01-11|url=https://github.com/jolicode/php-ar-drone|publisher=JoliCode|access-date=2019-02-23}}</ref>.
 
The standard PHP interpreter, powered by the [[Zend Engine]], is [[free software]] released under the [[PHP License]]. PHP has been widely ported and can be deployed on most web servers on almost every [[operating system]] and [[computing platform|platform]], free of charge.<ref name="foundations" />
Line 38:
The PHP language evolved without a written [[formal specification]] or standard until 2014, with the original implementation acting as the ''[[de facto]]'' standard which other implementations aimed to follow. Since 2014, work has gone on to create a formal PHP specification.<ref>{{cite web|last1=Jackson|first1=Joab|title=PHP gets a formal specification, at last|url=http://www.itworld.com/software/429534/php-gets-formal-specification-last|website=ITworld|publisher=[[International Data Group|IDG]]|date=2014-07-31}}</ref>
 
As of July 2019, the majority of sites on the web using PHP are still on version 5.6 or older;<ref name="PHP 5"/> versions prior to 7.1 are no longer officially supported by The PHP Development Team,<ref name="eol"/>, but security support is provided for longer by third parties, such as [[Debian]].<ref name="Jessie"/>
 
== History ==
Line 234:
| 30 November 2017
| 30 November 2020<ref name="supportedversions"/>
| Object parameter and return type hint,<ref>{{cite web|url=https://wiki.php.net/rfc/object-typehint|title=PHP: rfc:object-typehint|website=wiki.php.net}}</ref>, Libsodium extension,<ref>{{cite web|url=https://wiki.php.net/rfc/libsodium|title=PHP: rfc:libsodium|website=wiki.php.net}}</ref>, Abstract method overriding,<ref>{{cite web|url=https://wiki.php.net/rfc/allow-abstract-function-override|title=PHP: rfc:allow-abstract-function-override|website=wiki.php.net}}</ref>, Parameter type widening<ref>{{cite web|url=https://wiki.php.net/rfc/parameter-no-type-variance|title=PHP: rfc:parameter-no-type-variance|website=wiki.php.net}}</ref>
|-
| {{Version |c | 7.3}}
| 6 December 2018<ref>{{cite web|url=https://wiki.php.net/todo/php73|title=PHP: todo:php73|website=wiki.php.net}}</ref>
| 6 December 2021
| Flexible [[Here_documentHere document#PHP|Heredoc]] and Nowdoc syntax,<ref>{{cite web|url=https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes|title=PHP: rfc:flexible_heredoc_nowdoc_syntaxes|website=wiki.php.net}}</ref>, support for reference assignment and array deconstruction with list(),<ref>{{cite web|url=https://wiki.php.net/rfc/list_reference_assignment|title=PHP: rfc:list_reference_assignment|website=wiki.php.net}}</ref>, PCRE2 support,<ref>{{cite web|url=https://wiki.php.net/rfc/pcre2-migration|title=PHP: rfc:pcre2-migration|website=wiki.php.net}}</ref>, hrtime() function<ref>{{cite web|url=http://php.net/manual/en/function.hrtime.php|title=PHP: hrtime - Manual|website=php.net}}</ref>
|-
|{{Version |p | 7.4}}
|28 November 2019<ref>{{Cite web|url=https://wiki.php.net/todo/php74|title=PHP 7.4 Preparation Tasks|last=|first=|date=|website=php.net|access-date=}}</ref>
|December 2022
|Typed Properties 2.0,<ref>{{Cite web|url=https://wiki.php.net/rfc/typed_properties_v2|title=PHP: rfc:typed_properties_v2|website=wiki.php.net|access-date=2019-04-04}}</ref>, Preloading,<ref>{{Cite web|url=https://wiki.php.net/rfc/preload|title=PHP: rfc:preload|website=wiki.php.net|access-date=2019-04-04}}</ref>, Null Coalescing Assignment Operator,<ref>{{Cite web|url=https://wiki.php.net/rfc/null_coalesce_equal_operator|title=PHP: rfc:null_coalesce_equal_operator|website=wiki.php.net|access-date=2019-04-04}}</ref>, Improve openssl_random_pseudo_bytes,<ref>{{Cite web|url=https://wiki.php.net/rfc/improve-openssl-random-pseudo-bytes|title=PHP: rfc:improve-openssl-random-pseudo-bytes|website=wiki.php.net|access-date=2019-04-04}}</ref>, Weak References,<ref>{{Cite web|url=https://wiki.php.net/rfc/weakrefs|title=PHP: rfc:weakrefs|website=wiki.php.net|access-date=2019-04-05}}</ref>, FFI - Foreign Function Interface<ref>{{Cite web|url=https://wiki.php.net/rfc/ffi|title=PHP: rfc:ffi|website=wiki.php.net|access-date=2019-04-05}}</ref>
Always available hash extension,<ref>{{Cite web|url=https://wiki.php.net/rfc/permanent_hash_ext|title=PHP: rfc:permanent_hash_ext|website=wiki.php.net|access-date=2019-04-05}}</ref>, Password Hash Registry,<ref>{{Cite web|url=https://wiki.php.net/rfc/password_registry|title=PHP: rfc:password_registry|website=wiki.php.net|access-date=2019-04-05}}</ref>, Split multibyte string,<ref>{{Cite web|url=https://wiki.php.net/rfc/mb_str_split|title=PHP: rfc:mb_str_split|website=wiki.php.net|access-date=2019-04-05}}</ref>, Reflection for references,<ref>{{Cite web|url=https://wiki.php.net/rfc/reference_reflection|title=PHP: rfc:reference_reflection|website=wiki.php.net|access-date=2019-04-05}}</ref>, Unbundle ext/wddx,<ref>{{Cite web|url=https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx|title=PHP: rfc:deprecate-and-remove-ext-wddx|website=wiki.php.net|access-date=2019-04-05}}</ref>, New custom object serialization mechanism<ref>{{Cite web|url=https://wiki.php.net/rfc/custom_object_serialization|title=PHP: rfc:custom_object_serialization|website=wiki.php.net|access-date=2019-04-05}}</ref>
|-
|{{Version |p | 8.0}}
|Q4 2020 or Q1 2021
|Q4 2023 or Q1 2024
|[[Just-in-time compilation|Just In Time compilation (JIT)]],<ref>{{Cite web|url=https://wiki.php.net/rfc/jit|title=PHP: rfc:jit|website=wiki.php.net|access-date=2019-04-05}}</ref>, arrays starting with a negative index,<ref>{{Cite web|url=https://wiki.php.net/rfc/negative_array_index|title=PHP: rfc:negative_array_index|website=wiki.php.net|access-date=2019-04-05}}</ref>, consistent type errors for internal functions,<ref>{{Cite web|url=https://wiki.php.net/rfc/consistent_type_errors|title=PHP: rfc:consistent_type_errors|website=wiki.php.net|access-date=2019-04-05}}</ref>, fatal error for incompatible method signatures<ref>{{Cite web|url=https://wiki.php.net/rfc/lsp_errors|title=PHP: rfc:lsp_errors|website=wiki.php.net|access-date=2019-05-26}}</ref>
|- class="sortbottom"
| colspan="4" | {{Version |l |show=111111}}
Line 262:
The mascot of the PHP project is the ''elePHPant'', a blue [[elephant]] with the PHP logo on its side, designed by Vincent Pontier<ref>{{cite web|title=PHP: ElePHPant|url=http://php.net/elephpant.php|date=4 Oct 2014|access-date=4 Oct 2014}}</ref> in 1998.<ref>{{cite web|url=https://wwphp-fb.github.io/faq/community/elephpant/|title=Redirecting…|website=wwphp-fb.github.io}}</ref> "The (PHP) letters were forming the shape of an elephant if viewed in a sideways angle."<ref>{{cite web|url=https://7php.com/elephpant/|title=The PHP Mascot's Birth - Creator Of The elePHPant Vincent Pontier Reveals The True Story!|website=7php.com}}</ref> The elePHPant is sometimes differently colored when in [[plush toy]] form.
 
Many variations of this mascot have been made over the years. Only the elePHPants based on the original design by Vincent Pontier are considered official by the community.<ref>{{cite web|title=PHP: ElePHPant|url=http://php.net/elephpant.php}}</ref>. These are highly collectible and some of them are extremely rare. Different variations are listed on [http://afieldguidetoelephpants.net/ A Field Guide to Elephpants].{{clear}}
 
== Syntax ==
Line 758:
|archivedate = 2013-09-21
|df =
}}</ref> The best practice is to either locate the image directory outside of the document root available to the web server and serve it via intermediary script, or disable PHP execution for the directory which stores the uploaded files.
 
Also, enabling the dynamic loading of PHP extensions (via <code>enable_dl</code> configuration directive)<ref>{{cite web
Line 783:
 
== See also ==
{{Portal|PHP|Computer programming|Free and open-source software}}
 
{{Div col|colwidth=25em}}
Line 834:
[[Category:PHP]]
[[Category:Procedural programming languages]]
[[Category:Programming languages created in 1995]]
[[Category:Scripting languages]]
[[Category:Software using the PHP license]]