Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
PHP
(section)
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!
== History == {{multiple image | align = right | width = 105 | image1 = Rasmus Lerdorf cropped.jpg | image2 = Andi Gutmans 1.jpg | image3 = Zeev Suraski 2005 cropped.jpg | footer = [[Rasmus Lerdorf]], creator of PHP; and [[Andi Gutmans]] and [[Zeev Suraski]], creators of the [[Zend Engine]] }} === Early history === PHP development began in 1993<ref name="Krill-2013" /> when [[Rasmus Lerdorf]] wrote several [[Common Gateway Interface]] (CGI) programs in [[C-programming|C]],<ref name="Lerdorf-2012">{{cite web | url = https://twitter.com/rasmus/status/226405807305138176 | title = I wonder why people keep writing that PHP was ever written in Perl. It never was. #php | last = Lerdorf | first = Rasmus | publisher = Twitter | date = 2012-07-20 | access-date = 2014-09-04}}</ref><ref>{{cite web | url = http://itc.conversationsnetwork.org/shows/detail3298.html | title = PHP on Hormones | format = mp3 | last = Lerdorf | first = Rasmus | publisher = The Conversations Network | date = 2007-04-26 | access-date = 2009-06-22 | archive-date = 2019-01-06 | archive-url = https://web.archive.org/web/20190106230504/http://web.archive.org/web/20130729204354id_/http://itc.conversationsnetwork.org/shows/detail3298.html | url-status = dead }}</ref> which he used to maintain his [[personal homepage]]. He extended them to work with [[web form]]s and to communicate with [[database]]s, and called this implementation "Personal Home Page/Forms Interpreter" or PHP/FI. An example of the early PHP [[Syntax (programming languages)|syntax]]:<ref>{{cite web|last=Lerdorf|first=Rasmus|year=2007|title=Slide 3|url=http://talks.php.net/show/mysql07key/3|access-date=2009-06-22|work=slides for 'PHP on Hormones' talk|publisher=The PHP Group}}</ref> <syntaxhighlight lang="html"> <!--include /text/header.html--> <!--getenv HTTP_USER_AGENT--> <!--if substr $exec_result Mozilla--> Hey, you are using Netscape!<p> <!--endif--> <!--sql database select * from table where user='$username'--> <!--ifless $numentries 1--> Sorry, that record does not exist<p> <!--endif exit--> Welcome <!--$user-->!<p> You have <!--$index:0--> credits left in your account.<p> <!--include /text/footer.html--> </syntaxhighlight> PHP/FI could be used to build simple, [[dynamic web application]]s. To accelerate [[software bug|bug]] reporting and improve the code, Lerdorf initially announced the release of PHP/FI as "Personal Home Page Tools (PHP Tools) version 1.0" on the [[Usenet]] discussion group ''comp.infosystems.www.authoring.cgi'' on 8 June 1995.<ref name="Lerdorf-1995">{{cite web|url= https://groups.google.com/group/comp.infosystems.www.authoring.cgi/msg/cc7d43454d64d133?pli=1 |title=Announce: Personal Home Page Tools (PHP Tools)|last=Lerdorf|first=Rasmus|date=June 8, 1995|access-date=7 June 2011}}</ref><ref>{{cite newsgroup | title = Announce: Personal Home Page Tools (PHP Tools) | author = Lerdorf, Rasmus | date = 1995-06-08 | newsgroup = comp.infosystems.www.authoring.cgi | url = https://groups.google.com/group/comp.infosystems.www.authoring.cgi/msg/cc7d43454d64d133 | access-date = 2006-09-17}}</ref> This release included basic functionality such as [[Local variable#Local variables in Perl|Perl-like variables]], form handling, and the ability to embed [[HTML]]. By this point, the [[syntax]] had changed to resemble that of [[Perl]], but was simpler, more limited, and less consistent.<ref name="php.net-3" /><ref name="The PHP Group" /> Early PHP was never intended to be a new [[Programming language theory|programming language]]; rather, it grew organically, with Lerdorf noting in retrospect: "I don't know how to stop it [...] there was never any intent to write a programming language [...] I have absolutely no idea how to write a programming language [...] I just kept adding the next logical step on the way."<ref name="Rasmus Lerdorf-2003">{{cite web|title = Rasmus Lerdorf, Senior Technical Yahoo: PHP, Behind the Mic|date = 2003-11-19|url =http://itc.conversationsnetwork.org/shows/detail58.html|archive-url = https://web.archive.org/web/20130728125152/http://itc.conversationsnetwork.org/shows/detail58.html|archive-date = 2013-07-28}}</ref> A development team began to form and, after months of work and [[Beta development stage|beta]] testing, officially released PHP/FI 2 in November 1997.<ref>{{Cite web |last1=Alshetwi |first1=A.B. |last2=Rahmat |first2=R. A. A. O. |last3=Borhan |first3=M. N. |last4=Ismael |first4=S. |last5=Ali |first5=A. |last6=Irtema |first6=H. I. M. |last7=Alfakhria |first7=A. Y. |date=2018 |title=Web-Based Expert System for Optimizing of Traffic Road in Developing Countries |url=https://www.researchgate.net/publication/326727672 |access-date=13 Feb 2024}}</ref> The fact that PHP was not originally designed, but instead was developed organically has led to inconsistent naming of functions and inconsistent ordering of their parameters.<ref>{{cite web|title=Problems with PHP|url=http://toykeeper.net/soapbox/php_problems/|access-date=20 December 2010}}</ref> In some cases, the function names were chosen to match the lower-level libraries which PHP was "wrapping",<ref>{{cite web|url=http://news.php.net/php.internals/70950 |title=php.internals: Re: Function name consistency |website=news.php.net |date=2013-12-28 |access-date=2014-02-09}}</ref> while in some very early versions of PHP the length of the function names was used internally as a [[hash function]], so names were chosen to improve the distribution of [[hash values]].<ref name="Rasmus Lerdorf-2013">{{cite newsgroup |title=Re: Flexible function naming |author=[[Rasmus Lerdorf]] |date=Dec 16, 2013 |newsgroup=php.internals |url=http://news.php.net/php.internals/70691 |access-date=December 26, 2013}}</ref> === PHP 3 and 4 === [[File:Custom-software-developement-php-net.JPG|thumb|This is an example of PHP code for the [[WordPress]] [[content management system]].]] [[Zeev Suraski]] and [[Andi Gutmans]] rewrote the [[parser]] in 1997 and formed the base of PHP 3, changing the language's name to the [[recursive acronym]] ''PHP: Hypertext Preprocessor''.<ref name="The PHP Group" /><ref>{{cite web|title=PHP{{snd}} Acronym Meaning Vote |url=http://il.php.net/vote_listing.php3 |website=PHP.net |archive-date=August 15, 2000 |url-status=dead |archive-url=https://web.archive.org/web/20000815063125/http://il.php.net/vote_listing.php3}}</ref> Afterwards, public testing of PHP 3 began, and the official launch came in June 1998. Suraski and Gutmans then started a new [[rewrite (programming)|rewrite]] of PHP's core, producing the [[Zend Engine]] in 1999.<ref>{{cite web | title = Zend Engine version 2.0: Feature Overview and Design | publisher = [[Zend]] Technologies Ltd. | url = http://www.zend.com/zend/zend-engine-summary.php | access-date = 2006-09-17 | archive-url = https://web.archive.org/web/20060719204721/http://www.zend.com/zend/zend-engine-summary.php | archive-date = 2006-07-19 | url-status = dead}}</ref> They also founded [[Zend Technologies]] in [[Ramat Gan]], [[Israel]].<ref name="The PHP Group" /> On 22 May 2000, PHP 4, powered by the Zend Engine 1.0, was released.<ref name="The PHP Group" /> By August 2008, this branch had reached version 4.4.9. PHP 4 is now no longer under development and nor are any security updates planned to be released.<ref name="The PHP Group-2007a">{{cite web|title=php.net 2007 news archive|url=https://www.php.net/archive/2007.php|publisher=The PHP Group|access-date=2008-02-22|date=2007-07-13}}</ref><ref>{{cite web |access-date=2018-12-16 |url=https://www.internetnews.com/developer/php-4-is-dead%ef%bf%bdlong-live-php-5/|title=PHP 4 is Dead—Long Live PHP 5 |publisher=InternetNews |date=2008-02-01 |last=Kerner |first=Sean Michael |archive-url=https://web.archive.org/web/20180806115411/http://www.internetnews.com/dev-news/article.php/3725291 |archive-date=2018-08-06}}</ref> === PHP 5 === On 1 July 2004, PHP 5 was released, powered by the new Zend Engine II.<ref name="The PHP Group" /> PHP 5 included new features such as improved support for [[object-oriented programming]], the PHP Data Objects (PDO) extension (which defines a lightweight and consistent interface for accessing databases), and numerous performance enhancements.<ref>{{cite web|title=Why PHP 5 Rocks!|url=http://www.onlamp.com/pub/a/php/2004/07/15/UpgradePHP5.html|publisher=O'Reilly|access-date=2008-02-22|date=2004-07-15|author=Trachtenberg, Adam|archive-date=2016-03-31|archive-url=https://web.archive.org/web/20160331232050/http://www.onlamp.com/pub/a/php/2004/07/15/UpgradePHP5.html|url-status=dead}}</ref> In 2008, PHP 5 became the only stable version under development. [[Late static binding]] had been missing from previous versions of PHP, and was added in version 5.3.<ref>{{cite web|url=http://www.digitalsandwich.com/archives/53-Late-Static-Binding-in-PHP.html|access-date=2008-03-25|title=Late Static Binding in PHP|date=2006-02-23|publisher=Digital Sandwich}}</ref><ref>{{cite web|access-date=2008-03-25|url=https://www.php.net/language.oop5.static|title=Static Keyword|publisher=The PHP Group}}</ref> Many high-profile open-source projects ceased to support PHP 4 in new code from February 5, 2008, because of the GoPHP5 initiative,<ref name="GoPHP5">{{cite web | url=http://www.gophp5.org/projects|title=GoPHP5 | url-status=dead | archive-url=https://web.archive.org/web/20110717133313/http://gophp5.org/projects | archive-date=2011-07-17}}</ref> provided by a consortium of PHP developers promoting the transition from PHP 4 to PHP 5.<ref name="GoPHP5 Press Release">{{cite web |url=http://gophp5.org/sites/gophp5.org/files/press_release.pdf |title=PHP projects join forces to Go PHP 5 |access-date=2008-02-23 |work=GoPHP5 Press Release | url-status=dead | archive-url=https://web.archive.org/web/20190804012720/http://gophp5.org/sites/gophp5.org/files/press_release.pdf | archive-date=2019-08-04}}</ref><ref>{{cite web|url=http://gophp5.org/|title=GoPHP5|publisher=GoPHP5|access-date=2008-02-22 | url-status=dead | archive-url=https://web.archive.org/web/20110427101913/http://www.gophp5.org/ | archive-date=2011-04-27}}</ref> Over time, PHP interpreters became available on most existing [[32-bit]] and [[64-bit]] operating systems, either by building them from the PHP source code or by using pre-built binaries.<ref>{{cite web | url = https://www.php.net/manual/en/install.php | title = PHP Installation and Configuration | access-date = 2013-10-29 | website = php.net }}</ref> For PHP versions 5.3 and 5.4, the only available [[Microsoft Windows]] binary distributions were 32-bit [[IA-32]] builds,<ref>{{cite web | url = https://windows.php.net/download/#php-5.3 | title = PHP for Windows: Binaries and sources releases (5.3) | access-date = 2013-10-29 | website = php.net }}</ref><ref>{{cite web | url = https://windows.php.net/download/#php-5.4 | title = PHP for Windows: Binaries and sources releases (5.4) | access-date = 2013-10-29 | website = php.net }}</ref> requiring Windows 32-bit compatibility mode while using [[Internet Information Services]] (IIS) on a 64-bit Windows platform. PHP version 5.5 made the 64-bit [[x86-64]] builds available for Microsoft Windows.<ref>{{cite web | url = https://windows.php.net/download/#php-5.5 | title = PHP for Windows: Binaries and sources releases (5.5) | access-date = 2013-10-29 | website = php.net }}</ref> Official security support for PHP 5.6 ended on 31 December 2018.<ref>{{Cite web | url=https://php.net/supported-versions.php |title = PHP: Supported Versions}}</ref> === <span id="PHP6-UNICODE">PHP 6 and Unicode</span> === PHP received mixed reviews due to lacking native [[Unicode]] support at the core language level.<ref>{{cite web | url = https://php.net/manual/en/language.types.string.php | title = Types: Strings (PHP Manual) | access-date = 2013-09-22 | website = PHP.net }}</ref><ref>{{cite web | url = https://www.php.net/manual/en/language.types.string.php#language.types.string.details | title = Details of the String Type (PHP Manual) | access-date = 2021-09-22 | website = PHP.net }}</ref> In 2005, a project headed by Andrei Zmievski was initiated to bring native [[Unicode]] support throughout PHP, by embedding the [[International Components for Unicode]] (ICU) library, and representing text strings as [[UTF-16]] internally.<ref>{{cite mailing list|url=http://marc.info/?l=php-internals&m=112365908921757&w=1|title=PHP Unicode support design document|date=2005-08-10|access-date=2014-02-09|author=Andrei Zmievski}}</ref> Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.<ref>{{cite web|url=http://news.php.net/php.internals/17668|title=PHP 5.5 or 6.0|access-date=2014-02-09}}</ref> However, a shortage of developers who understood the necessary changes, and performance problems arising from conversion to and from UTF-16, which is rarely used in a web context, led to delays in the project.<ref>{{cite web|title=The Good, the Bad, and the Ugly: What Happened to Unicode and PHP 6|url=http://www.slideshare.net/andreizm/the-good-the-bad-and-the-ugly-what-happened-to-unicode-and-php-6|access-date=2014-02-09|author=Andrei Zmievski|date=2011-04-22}}</ref> As a result, a PHP 5.3 release was created in 2009, with many non-Unicode features back-ported from PHP 6, notably namespaces. In March 2010, the project in its current form was officially abandoned, and a PHP 5.4 release was prepared to contain most remaining non-Unicode features from PHP 6, such as traits and closure re-binding.<ref>{{cite mailing list|url=http://news.php.net/php.internals/47120|title=PHP 6|access-date=2014-02-07|date=2010-03-11|author=Rasmus Lerdorf}}</ref> Initial hopes were that a new plan would be formed for Unicode integration, but by 2014 none had been adopted.{{Citation needed|date=November 2023}} === PHP 7 === During 2014 and 2015, a new major PHP version was developed, PHP 7. The numbering of this version involved some debate among internal developers.<ref>{{cite web|url=https://philsturgeon.uk/php/2014/07/23/neverending-muppet-debate-of-php-6-v-php-7/|title=The Neverending Muppet Debate of PHP 6 v PHP 7|access-date=2015-11-19|archive-url=https://web.archive.org/web/20151119132438/https://philsturgeon.uk/php/2014/07/23/neverending-muppet-debate-of-php-6-v-php-7/|archive-date=2015-11-19|url-status=dead}}</ref> While the PHP 6 Unicode experiments had never been released, several articles and book titles referenced the PHP 6 names, which might have caused confusion if a new release were to reuse the name.<ref>{{cite web |title=RFC: Name of Next Release of PHP |url=https://wiki.php.net/rfc/php6 |date=2014-07-07 |access-date=2014-07-15 |website=php.net}}</ref> After a vote, the name PHP 7 was chosen.<ref>{{cite web|title=Re: [PHP-DEV] [VOTE] [RFC] Name of Next Release of PHP (again) |url=https://www.mail-archive.com/internals@lists.php.net/msg68598.html |date=2014-07-30 |access-date=2014-07-30}}</ref> The foundation of PHP 7 is a PHP [[branching (version control)|branch]] that was originally dubbed ''PHP next generation'' (''phpng''). It was authored by Dmitry Stogov, Xinchen Hui and Nikita Popov,<ref>{{cite web|url=http://news.php.net/php.internals/73888|title=phpng: Refactored PHP Engine with Big Performance Improvement|website=news.php.net}}</ref> and aimed to optimize PHP performance by refactoring the Zend Engine while retaining near-complete language compatibility.<ref>{{cite web |url=https://wiki.php.net/rfc/phpng |title=PHP: rfc:phpng |access-date=16 December 2014 |website=php.net}}</ref> By 14 July 2014, [[WordPress]]-based benchmarks, which served as the main benchmark suite for the phpng project, showed an almost 100% increase in performance. Changes from phpng make it easier to improve performance in future versions, as more compact data structures and other changes are seen as better suited for a successful migration to a [[Just-in-time compilation|just-in-time]] (JIT) compiler.<ref name="php.net-7">{{cite web|url=https://wiki.php.net/phpng |title=PHP: phpng |website=php.net |access-date=2014-07-15}}</ref> Because of the significant changes, the reworked Zend Engine was called ''Zend Engine 3'', succeeding Zend Engine 2 used in PHP 5.<ref name="github.com-2014">{{cite web |url=https://github.com/php/php-src/commit/150dc69d6eee35738f505e925ee664c02060196d |website=github.com |date=2014-12-05 |access-date=2014-12-05 |title=Merge branch 'ZendEngine3'}}</ref> Because of the major internal changes in phpng, it must receive a new [[Software versioning|major version]] number of PHP, rather than a minor PHP 5 release, according to PHP's release process.<ref name="PHP-2011" /> Major versions of PHP are allowed to break backward-compatibility of code and therefore PHP 7 presented an opportunity for other improvements beyond phpng that require backward-compatibility breaks.{{Citation needed|date=April 2024}} In particular, it involved the following changes: * Many fatal or recoverable-level legacy PHP error mechanisms were replaced with modern object-oriented [[Exception (computer science)|exceptions]].<ref name="php.net" /> * The syntax for variable dereferencing was reworked to be internally more consistent and complete, allowing the use of the operators <code>-></code>, <code>[]</code>, <code>()</code>,<code>{}</code>, and <code>::</code>, with arbitrary meaningful left-side expressions.<ref name="php.net-2014b">{{cite web |url=https://wiki.php.net/rfc/uniform_variable_syntax |title=PHP RFC: Uniform Variable Syntax |date=2014-05-31 |access-date=2014-07-30 |website=php.net}}</ref> * Support for legacy PHP 4-style constructor methods was deprecated.<ref>{{Cite web|url=https://3v4l.org/udRhX|title=Online PHP editor | output for udRhX|website=3v4l.org}}</ref> * The behavior of the [[foreach loop|<code>foreach</code> statement]] was changed to be more predictable.<ref>{{cite web|url=https://wiki.php.net/rfc/php7_foreach|title=PHP RFC: Fix "foreach" behavior|access-date=2015-05-21|website=php.net}}</ref> * Constructors for the few classes built-in to PHP which returned null upon failure were changed to throw an exception instead, for consistency.<ref>{{cite web|url=https://wiki.php.net/rfc/internal_constructor_behaviour|title=PHP RFC: Constructor behaviour of internal classes|access-date=2015-05-21|website=php.net}}</ref> * Several unmaintained or deprecated [[server application programming interface]]s (SAPIs) and extensions were removed from the PHP core, most notably the legacy <code>mysql</code> extension.<ref>{{cite web|url=https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts|title=PHP RFC: Removal of dead or not yet PHP7 ported SAPIs and extensions|access-date=2015-05-21|website=php.net}}</ref> * The behavior of the <code>list()</code> operator was changed to remove support for strings.<ref>{{cite web|url=https://wiki.php.net/rfc/fix_list_behavior_inconsistency|title=PHP RFC: Fix list() behavior inconsistency|access-date=2015-05-21|website=php.net}}</ref> * Support was removed for legacy ASP-style delimiters <code><%</code> and <code>%></code> and <code><script language="php"> ... </script></code>.<ref>{{cite web|url=https://wiki.php.net/rfc/remove_alternative_php_tags|title=PHP RFC: Remove alternative PHP tags|access-date=2015-05-21|website=php.net}}</ref> * An oversight allowing a [[switch statement]] to have multiple <code>default</code> clauses was fixed.<ref>{{cite web|url=https://wiki.php.net/rfc/switch.default.multiple|title=PHP RFC: Make defining multiple default cases in a switch a syntax error|access-date=2015-05-21|website=php.net}}</ref> * Support for hexadecimal number support in some implicit conversions from strings to number types was removed.<ref>{{cite web|url=https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings|title=PHP RFC: Remove hex support in numeric strings|access-date=2015-05-21|website=php.net}}</ref> * The [[left-shift operator|left-shift]] and [[right-shift operator|right-shift]] operators were changed to behave more consistently across platforms.<ref name="php.net-5" /> * Conversions between floating-point numbers and integers were changed (e.g. infinity changed to convert to zero) and implemented more consistently across platforms.<ref name="php.net-5">{{cite web|url=https://wiki.php.net/rfc/integer_semantics|title=PHP RFC: Integer Semantics|access-date=2015-05-21|quote=Making NaN and Infinity always become zero when cast to integer means more cross-platform consistency, and is also less surprising than what is currently produces|website=php.net}}</ref><ref>{{cite web|url=https://wiki.php.net/rfc/zpp_fail_on_overflow|title=PHP RFC: ZPP Failure on Overflow|access-date=2015-05-21|website=php.net}}</ref> PHP 7 also included new language features. Most notably, it introduced return type declarations for functions<ref name="php.net-2015a">{{cite web |url=https://wiki.php.net/rfc/return_types |title=RFC: Return Types |date=2015-01-27 |access-date=2015-01-28 |website=php.net}}</ref> which complement the existing parameter type declarations, and support for the [[Variable (computer science)|scalar]] types (integer, float, string, and boolean) in parameter and return type declarations.<ref name="php.net-2015b">{{cite web|url=https://wiki.php.net/rfc/scalar_type_hints_v5|title=RFC: Scalar Type Declarations |date=2015-03-16 |access-date=2015-03-17 |website=php.net}}</ref> === PHP 8 === PHP 8 was released on 26 November 2020, and is currently the second-most used PHP major version. PHP 8 is a major version and has breaking changes from previous versions.<ref name="Brent">{{cite web |author=Brent |title=What's new in PHP 8 |url=https://stitcher.io/blog/new-in-php-8 |website=Stitcher |access-date=22 September 2020}}</ref><ref name="PHP">{{cite web |title=PHP 8 Released|url=https://www.php.net/releases/8.0/en.php |website=PHP |access-date=27 November 2020}}</ref> New features and notable changes include: ==== Just-in-time compilation ==== [[Just-in-time compilation]] is supported in PHP 8.<ref name="wiki.php.net-2" /> PHP 8's [[just-in-time compilation|JIT compiler]] can provide substantial performance improvements for some use cases,<ref name="Brent-2">{{cite web |author=Brent |title=PHP 8: JIT performance in real-life web applications |url=https://stitcher.io/blog/jit-in-real-life-web-applications |website=Stitcher.io |access-date=4 October 2020}}</ref><ref>{{cite web |last1=Rethams |first1=Derick |title=PHP 8: A Quick Look at JIT |url=https://derickrethans.nl/a-quick-look-at-jit.html}}</ref> while (then PHP) developer Nikita Popov stated that the performance improvements for most websites will be less substantial than the upgrade from PHP 5 to PHP 7.<ref name="Popov-2020" /> Substantial improvements are expected more for mathematical-type operations than for common web-development use cases.<ref name="Popov-2020">{{cite web |last1=Popov |first1=Nikita |title="What's new in PHP 8.0?" Nikita Popov |date=13 July 2020 |url=https://www.youtube.com/watch?v=NbBRXwu1Md8 |archive-url=https://ghostarchive.org/varchive/youtube/20211211/NbBRXwu1Md8| archive-date=2021-12-11 |url-status=live|publisher=PHP fwdays |access-date=4 October 2020}}{{cbignore}}</ref> Additionally, the JIT compiler provides the future potential to move some code from C to PHP, due to the performance improvements for some use cases.<ref name="Daniele-2020">{{cite web |last1=Daniele |first1=Carlo |title=What's New in PHP 8 (Features, Improvements, and the JIT Compiler) |url=https://kinsta.com/blog/php-8/ |website=Kinsta |date=25 May 2020 |access-date=24 December 2020}}</ref> ==== Addition of the match expression ==== {{Main|PHP syntax and semantics#Match expression}} PHP 8 introduced the {{code|match}} expression.<ref name="Redmond-2020">{{cite web |last1=Redmond |first1=Paul |title=Match Expression is Coming to PHP 8 |url=https://laravel-news.com/match-expression-php-8 |website=Laravel News |date=15 July 2020 |access-date=4 October 2020}}</ref> The match expression is conceptually similar to a {{code|switch}} statement and is more compact for some use cases.<ref name="PHP Watch">{{cite web |title=PHP 8.0: Match Expressions |url=https://php.watch/versions/8.0/match-expression |website=PHP Watch |access-date=4 October 2020}}</ref> Because {{code|match}} is an expression, its result can be assigned to a variable or returned from a function.<ref>{{cite web |last1=Barnes |first1=Eric |title=PHP 8 is now Released! |url=https://laravel-news.com/php-8 |website=Laravel News |date=27 November 2020 |access-date=24 December 2020 |ref=laravel-news-php-8-released}}</ref> ==== Type changes and additions ==== PHP 8 introduced union types, a new {{code|static}} return type, and a new {{code|mixed}} type.<ref name="Brent" /> "Attributes", often referred to as "annotations" in other programming languages, were added in PHP 8, which allow metadata to be added to classes.<ref name="Brent" /> {{code|throw}} was changed from being a statement to being an expression.<ref name="wiki.php.net-4" /> This allows exceptions to be thrown in places that were not previously possible.<ref name="Brent" /> ==== Syntax changes and additions ==== PHP 8 includes changes to allow alternate, more concise, or more consistent syntaxes in a number of scenarios. For example, the nullsafe operator is similar to the [[null coalescing operator]] {{code|??}}, but used when calling methods.<ref name="wiki.php.net" /> The following code snippet will not throw an error if {{code|getBirthday()}} returns null: <syntaxhighlight lang="php"> $human_readable_date = $user->getBirthday()?->diffForHumans(); </syntaxhighlight> Constructor property promotion has been added as "[[syntactic sugar]]," allowing class properties to be set automatically when parameters are passed into a class [[Constructor (object-oriented programming)|constructor]].<ref name="Brent" /> This reduces the amount of [[boilerplate code]] that must be written.<ref>{{cite web |last1=Roose |first1=Brent |title=PHP 8: Constructor property promotion |url=https://stitcher.io/blog/constructor-promotion-in-php-8 |access-date=30 April 2024}}</ref> Other minor changes include support for use of {{code|::class}} on objects, which serves as an alternative for the use of {{code|get_class()}};<ref name="Brent" /> non-capturing catches in try-catch blocks; variable syntax tweaks to resolve inconsistencies; support for named arguments; and support for trailing commas in parameter lists, which adds consistency with support for trailing commas in other contexts, such as in arrays.<ref name="PHP" /> ==== Standard library changes and additions ==== * Weak maps were added in PHP 8. A {{code|WeakMap}} holds references to objects, but these references do not prevent such objects from being [[Garbage collection (computer science)|garbage collected]].<ref name="wiki.php.net-3" /> This can provide performance improvements in scenarios where data is being [[Cache (computing)|cached]]; this is of particular relevance for [[object–relational mapping]]s (ORM).<ref name="Brent" /> * Various adjustments to interfaces, such as adding support for creating {{code|DateTime}} objects from interfaces, and the addition of a {{code|Stringable}} interface that can be used for type hinting.<ref name="Brent" /> * Various new functions including {{code|lang=php|str_contains()}}, {{code|lang=php|str_starts_with()}}, and {{code|lang=php|str_ends_with()}};<ref name="Merchant-2020">{{cite web |last1=Merchant |first1=Amit |title=These new string functions are coming in PHP 8 |url=https://www.amitmerchant.com/new-string-functions-php8/ |website=Amit Merchant |date=13 June 2020 |access-date=4 October 2020}}</ref> {{code|lang=php|fdiv()}}; {{code|lang=php|get_debug_type()}}; and {{code|lang=php|get_resource_id()}}<ref name="Brent" /> * Object implementation of {{code|lang=php|token_get_all()}}<ref name="Brent" /> ==== Additional changes ==== * Type annotations were also added into PHP's C source code itself to allow internal functions and methods to have "complete type information in reflection."<ref>{{cite web |last1=Popov |first1=Nikita |title=Call for participation: Annotating internal function argument and return types |url=https://externals.io/message/106522 |website=Externals |access-date=19 November 2020}}</ref> * Inheritance with private methods<ref name="Brent" /> * Abstract methods in traits improvements<ref name="Brent" /> === PHP 8.1 === PHP 8.1 was released on November 25, 2021.<ref>{{Cite web|url=https://www.php.net/ChangeLog-8.php#8.1.0 |title=PHP 8 ChangeLog |access-date=2024-01-05 |website=PHP.net}}</ref> It added support for [[enumerated type|enumerations]] (also called "enums"), declaring properties as <code>readonly</code> (which prevents modification of the property after initialization), and array unpacking with string keys. The new [[bottom type|never type]] can be used to indicate that a function does not return.<ref>{{Cite web|title=PHP: PHP 8.1.0 Release Announcement |url=https://www.php.net/releases/8.1/en.php |access-date=2024-01-05 |website=PHP.net}}</ref> === PHP 8.2 === PHP 8.2 was released on December 8, 2022.<ref>{{Cite web|url=https://www.php.net/ChangeLog-8.php#8.2.0 |title=PHP 8 ChangeLog |access-date=2024-01-05 |website=PHP.net}}</ref> New in this release are <code>readonly</code> classes (whose instance properties are implicitly readonly), [[disjunctive normal form]] (DNF) types, and the <code>random</code> extension, which provides a [[pseudorandom number generator]] with an object-oriented [[API]],<ref>{{Cite web|title=PHP: PHP 8.2.0 Release Announcement |url=https://www.php.net/releases/8.2/en.php |access-date=2024-01-05 |website=PHP.net}}</ref> Sensitive Parameter value redaction, and a ton of other features. === PHP 8.3 === PHP 8.3 was released on November 23, 2023. This release introduced readonly array properties, allowing arrays to be declared as immutable after initialization.{{citation needed|date=February 2025}} It also added support for class aliases for built-in PHP classes, new methods for random float generation in the Random extension, and enhanced PHP INI settings with fallback value support. Additionally, the new {{Mono|stream_context_set_options}} function provides improved API for stream manipulation, among other updates and deprecations. === PHP 8.4 === PHP 8.4 was released on November 21, 2024. === Release history === <!-- Template:Version – for version & release history. Documentation and examples: [[Template:Version]] --> {{sticky header}} {{mw-datatable}} {| class="wikitable mw-datatable mw-collapsible sticky-header" |- ! Version ! style="min-width: 10em;" | Release date ! style="min-width: 10em;" | Supported until<ref name="php.net-2">{{cite web|url=https://php.net/eol.php |title=Unsupported Branches |website=php.net |access-date=2019-07-31}}</ref> ! Notes |- | {{Version |o | 1.0}} | 8 June 1995 | | Officially called "Personal Home Page Tools (PHP Tools)". This is the first use of the name "PHP".<ref name="The PHP Group" /> |- | {{Version |o | 2.0}} | 1 November 1997 | | Officially called "PHP/FI 2.0". This is the first release that could actually be characterised as PHP, being a standalone language with many features that have endured to the present day. |- | {{Version |o | 3.0}} | 6 June 1998 | 20 October 2000<ref name="php.net-2" /> | Development moves from one person to multiple developers. Zeev Suraski and Andi Gutmans rewritten the base for this version.<ref name="The PHP Group" /> |- | {{Version |o | 4.0}} | 22 May 2000<ref>{{cite web |title=PHP 4.0.0 Released |url=https://news-web.php.net/php.announce/22 |access-date=25 October 2020}}</ref> | 23 June 2001<ref name="php.net-2" /> | Added more advanced two-stage parse/execute tag-parsing system called the Zend engine.<ref name="The PHP Group-2008">{{cite web|title=PHP: PHP 4 ChangeLog|url=https://www.php.net/ChangeLog-4.php|publisher=The PHP Group|access-date=2008-02-22|date=2008-01-03}}</ref> |- | {{Version |o | 4.1}} | 10 December 2001<ref>{{cite web |title=PHP 4.1.0 Release Announcement |url=https://www.php.net/releases/4_1_0.php |access-date=25 October 2020}}</ref> | 12 March 2002<ref name="php.net-2" /> | Introduced "superglobals" ({{code|lang=php|$_GET}}, {{code|lang=php|code=$_POST}}, {{code|lang=php|code=$_SESSION}}, etc.)<ref name="The PHP Group-2008" /> |- | {{Version |o | 4.2}} | 22 April 2002<ref>{{cite web |title=PHP 4.2.0 Release Announcement |url=https://www.php.net/releases/4_2_0.php |access-date=25 October 2020}}</ref> | 6 September 2002<ref name="php.net-2" /> | Disabled <code>register_globals</code> by default. Data received over the network is not inserted directly into the [[global variable|global]] namespace anymore, closing possible security holes in applications.<ref name="The PHP Group-2008" /> |- | {{Version |o | 4.3}} | 27 December 2002<ref>{{cite web |title=PHP 4.3.0 Release Announcement |url=https://www.php.net/releases/4_3_0.php |access-date=25 October 2020}}</ref> | 31 March 2005<ref name="php.net-2" /> | Introduced the [[command-line interface]] (CLI), to supplement the CGI.<ref name="The PHP Group-2008" /><ref name="PHP Manual-2">{{cite web|title= Using PHP from the command line | work = PHP Manual|url=https://php.net/manual/en/features.commandline.php|publisher=The PHP Group|access-date=2009-09-11}}</ref> |- | {{Version |o | 4.4}} | 11 July 2005<ref>{{cite web |title=PHP 4.4.0 Release Announcement |url=https://www.php.net/releases/4_4_0.php |access-date=25 October 2020}}</ref> | 7 August 2008<ref name="php.net-2" /> | Fixed a memory corruption bug, which required breaking binary compatibility with extensions compiled against PHP version 4.3.x.<ref>{{cite web|title=PHP 4.4.0 Release Announcement|work=PHP Manual|url=https://php.net/releases/4_4_0.php|publisher=The PHP Group|access-date=2013-11-24}}</ref> |- | {{Version |o | 5.0}} | 13 July 2004<ref>{{cite web |title=PHP 5.0.0 Released! |url=https://news-web.php.net/php.announce/50 |access-date=25 October 2020}}</ref> | 5 September 2005<ref name="php.net-2" /> | Zend Engine II with a new object model.<ref name="The PHP Group-2007">{{cite web|title=PHP: PHP 5 ChangeLog|url=https://www.php.net/ChangeLog-5.php|publisher=The PHP Group|access-date=2008-02-22|date=2007-11-08}}</ref> |- | {{Version |o | 5.1}} | 24 November 2005<ref>{{cite web |title=PHP 5.1.0 Release Announcement |url=https://www.php.net/releases/5_1_0.php |access-date=25 October 2020}}</ref> | 24 August 2006<ref name="php.net-2" /> | Performance improvements with the introduction of compiler variables in re-engineered PHP Engine.<ref name="The PHP Group-2007" /> Added PHP Data Objects (PDO) as a consistent interface for accessing databases.<ref name="The PHP Group-2011">{{cite web|title=PHP manual: PDO|url=https://php.net/manual/en/intro.pdo.php|publisher=The PHP Group|access-date=2011-11-15|date=2011-11-15}}</ref> |- | {{Version |o | 5.2}} | 2 November 2006<ref>{{cite web |title=PHP 5.2.0 Release Announcement |url=https://www.php.net/releases/5_2_0.php |access-date=25 October 2020}}</ref> | 6 January 2011<ref name="php.net-2" /> | Enabled the filter extension by default. Native [[JSON]] support.<ref name="The PHP Group-2007" /> |- | {{Version |o | 5.3}} | 30 June 2009<ref>{{cite web |title=PHP 5.3.0 Release Announcement |url=https://www.php.net/releases/5_3_0.php |access-date=25 October 2020}}</ref> | 14 August 2014<ref name="php.net-2" /> | [[Namespace]] support; [[name binding|late static bindings]], jump label (limited [[goto]]), [[anonymous function]]s, [[closure (computer programming)|closures]], PHP archives (phar), [[garbage collection (computer science)|garbage collection]] for circular references, improved [[Microsoft Windows|Windows]] support, sqlite3, mysqlnd as a replacement for libmysql as the underlying library for the extensions that work with [[MySQL]], fileinfo as a replacement for mime_magic for better [[MIME]] support, the Internationalization extension, and deprecation of ereg extension. |- | {{Version |o | 5.4}} | 1 March 2012<ref>{{cite web |title=PHP 5.4.0 Release Announcement |url=https://www.php.net/releases/5_4_0.php |access-date=25 October 2020}}</ref> | 3 September 2015<ref name="php.net-2" /> | [[trait (computer programming)|Trait]] support, short array syntax support. Removed items: <code>register_globals</code>, <code>safe_mode</code>, <code>allow_call_time_pass_reference</code>, {{code|lang=php|code=session_register()}}, {{code|lang=php|code=session_unregister()}} and {{code|lang=php|code=session_is_registered()}}. Built-in web server.<ref>{{cite web|url=https://php.net/manual/en/features.commandline.webserver.php |title=Built-in web server |access-date=March 26, 2012}}</ref> Several improvements to existing features, performance and reduced memory requirements. |- | {{Version |o | 5.5}} | 20 June 2013<ref>{{cite web |title=PHP 5.5.0 Release Announcement |url=https://www.php.net/releases/5_5_0.php |access-date=25 October 2020}}</ref> | 10 July 2016<ref name="php.net-8">{{cite web|url=https://php.net/supported-versions.php |title=Supported Versions |website=php.net |access-date=2017-12-13}}</ref> | Support for [[generator (computer programming)|generators]], <code>finally</code> blocks for exceptions handling, OpCache (based on Zend Optimizer+) bundled in official distribution.<ref name="php.net-9">{{cite web|title=PHP 5.5.0 changes|url=https://php.net/manual/en/migration55.new-features.php|access-date=2015-03-03|website=php.net}}</ref> |- | {{Version |o | 5.6}} | 28 August 2014<ref>{{cite web |title=PHP 5.6.0 Release Announcement |url=https://www.php.net/releases/5_6_0.php |access-date=25 October 2020}}</ref> | 31 December 2018<ref name="php.net-8" /> | Constant scalar expressions, [[variadic function]]s, argument unpacking, new exponentiation operator, extensions of the <code>use</code> statement for functions and constants, new <code>phpdbg</code> debugger as a SAPI module, and other smaller improvements.<ref name="php.net-10">{{cite web |title=Migrating from PHP 5.5.x to PHP 5.6.x |url=https://www.php.net/manual/en/migration56.new-features.php |access-date=2014-03-24 |website=php.net}}</ref> |- | style="background:silver;"| 6.x | {{n/a|Not released}} | {{n/a}} | Abandoned version of PHP that planned to include native Unicode support.<ref>{{cite web|url=https://lwn.net/Articles/379909/|title=Resetting PHP 6|quote=There have been books on the shelves purporting to cover PHP 6 since at least 2008. But, in March 2010, the PHP 6 release is not out{{snd}} in fact, it is not even close to out. Recent events suggest that PHP 6 will not be released before 2011{{snd}} if, indeed, it is released at all.}}</ref><ref>{{cite news|url=http://www.infoworld.com/article/2841561/php/php-7-moves-full-speed-ahead.html|title=PHP 7 moves full speed ahead|newspaper=InfoWorld |quote=Recent versions of PHP have been part of the 5.x release series, but there will be no PHP 6. "We're going to skip [version] 6, because years ago, we had plans for a 6, but those plans were very different from what we're doing now," Gutmans said. Going right to version 7 avoids confusion.|date=2014-10-31 |last1=Krill |first1=Paul }}</ref> |- | {{Version |o | 7.0}} | 3 December 2015<ref name="php.net-2018">{{cite web |url=https://php.net/archive/2018.php#id2018-07-19-2|title=News Archive – 2018: PHP 7.2.9 Released |date=2018-08-16 |access-date=2018-08-16 |website=php.net}}</ref> | 10 January 2019<ref name="PHP-2011" /> | Zend Engine 3 (performance improvements<ref name="php.net-7" /> and 64-bit integer support on Windows<ref>{{cite web|url=https://wiki.php.net/rfc/size_t_and_int64_next|title=PHP: rfc:size_t_and_int64_next|website=php.net|access-date=16 December 2014}}</ref>), uniform variable syntax,<ref name="php.net-2014b" /> [[Abstract Syntax Tree|AST]]-based compilation process,<ref>{{cite web|url=https://wiki.php.net/rfc/abstract_syntax_tree|title=PHP: rfc:abstract_syntax_tree|website=php.net|access-date=16 December 2014}}</ref> added {{code|lang=php|code=Closure::call()}},<ref>{{cite web|url=https://wiki.php.net/rfc/closure_apply|title=PHP: rfc:closure_apply|website=php.net|access-date=16 December 2014}}</ref> bitwise shift consistency across platforms,<ref>{{cite web|url=https://wiki.php.net/rfc/integer_semantics|title=PHP: rfc:integer_semantics|website=php.net|access-date=16 December 2014}}</ref> {{code|lang=php|code=??}} ([[Null coalescing operator|null coalesce]]) operator,<ref>{{cite web|url=https://wiki.php.net/rfc/isset_ternary|title=PHP: rfc:isset_ternary|website=php.net|access-date=16 December 2014}}</ref> [[Unicode]] code point [[String literal#Escape sequences|escape syntax]],<ref>{{cite web|url=https://wiki.php.net/rfc/unicode_escape|title=RFC: Unicode Codepoint Escape Syntax|date=2014-11-24|access-date=2014-12-19}}</ref> return type declarations,<ref name="php.net-2015a" /> scalar type (integer, float, string and boolean) declarations,<ref name="php.net-2015b" /> <code><=></code> "spaceship" [[three-way comparison]] operator,<ref>{{cite web|url=https://wiki.php.net/rfc/combined-comparison-operator|title=Combined Comparison (Spaceship) Operator|website=php.net|access-date=2015-05-21}}</ref> [[Generator (computer programming)|generator]] delegation,<ref>{{cite web|url=https://wiki.php.net/rfc/generator-delegation|title=PHP RFC: Generator Delegation|access-date=2015-05-21|website=php.net}}</ref> [[anonymous class]]es,<ref>{{cite web|url=https://wiki.php.net/rfc/anonymous_classes|title=PHP RFC: Anonymous Classes|access-date=2015-05-21|website=php.net}}</ref> simpler and more consistently available [[CSPRNG]] API,<ref>{{cite web|url=https://wiki.php.net/rfc/easy_userland_csprng|title=PHP RFC: Easy User-land CSPRNG|access-date=2015-05-21|website=php.net}}</ref> replacement of many remaining internal PHP "errors" with the more modern [[Exception (computer science)|exceptions]],<ref name="php.net">{{cite web|url=https://wiki.php.net/rfc/engine_exceptions_for_php7|title=PHP RFC: Exceptions in the engine (for PHP 7)|access-date=2015-05-21|website=php.net}}</ref> and shorthand syntax for importing multiple items from a namespace.<ref>{{cite web|url=https://wiki.php.net/rfc/group_use_declarations|title=PHP RFC: Group Use Declarations|access-date=2015-05-21|website=php.net}}</ref> |- | {{Version |o | 7.1}} | 1 December 2016 | 1 December 2019<ref name="php.net-8" /> | {{code|lang=php|iterable}} type,<ref>{{cite web|url=https://wiki.php.net/rfc/iterable|title=PHP: rfc:iterable|website=php.net|date=2016-06-10|access-date=2023-06-30}}</ref> nullable types,<ref>{{cite web|url=https://wiki.php.net/rfc/nullable_types|title=PHP: rfc:nullable_types|website=php.net|date=2014-04-10|access-date=2023-06-30}}</ref> [[Void type|{{code|lang=php|void}} return type]],<ref>{{cite web|url=http://wiki.php.net/rfc/void_return_type|title=PHP: rfc:void_return_type|website=php.net|date=2015-11-09|access-date=2015-11-14}}</ref> class constant [[information hiding|visibility modifiers]],<ref>{{cite web|url=https://wiki.php.net/rfc/class_const_visibility|title=PHP: rfc:class_constant_visibility|website=php.net|date=2015-10-27|access-date=2015-12-08}}</ref> short list syntax,<ref>{{cite web|url=https://wiki.php.net/rfc/short_list_syntax|title=PHP: rfc:short_list_syntax|website=php.net|date=2016-04-07|access-date=2023-06-30}}</ref> multi-catch<ref>{{cite web|url=https://wiki.php.net/rfc/multiple-catch|title=PHP: rfc:multiple-catch|website=php.net|date=2016-03-06|access-date=2023-06-30}}</ref> |- | {{Version |o | 7.2}} | 30 November 2017 | 30 November 2020<ref name="php.net-8" /> | Object parameter and return type declaration,<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 |o | 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 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 {{code|lang=php|code=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> {{code|lang=php|code=hrtime}} function<ref>{{cite web|url=https://php.net/manual/en/function.hrtime.php|title=PHP: hrtime{{snd}} Manual|website=php.net}}</ref> |- | {{Version |o | 7.4}} | 28 November 2019<ref>{{Cite web|url=https://www.php.net/archive/2019.php#2019-11-28-1|title=PHP 7.4.0 Released!|website=php.net|access-date=2019-11-28}}</ref> | 28 November 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 {{code|lang=php|code=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 name="wiki.php.net-3">{{Cite web|url=https://wiki.php.net/rfc/weakrefs|title=PHP: rfc:weakrefs|website=wiki.php.net|access-date=2019-04-05}}</ref> [[foreign function interface]] (FFI),<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> multibyte string splitting,<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 |o | 8.0}} | 26 November 2020<ref>{{Cite web|url=https://www.php.net/supported-versions.php|title=PHP: Supported Versions|website=php.net|access-date=2023-11-26}}</ref> | 26 November 2023 | [[just-in-time compilation|Just-In-Time (JIT) compilation]],<ref name="wiki.php.net-2">{{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> stricter/saner language semantics (validation for abstract trait methods),<ref>{{cite web |title=PHP RFC: Validation for abstract trait methods |url=https://wiki.php.net/rfc/abstract_trait_method_validation |website=wiki.php.net |access-date=14 August 2020}}</ref> saner string to number comparisons,<ref>{{cite web |title=PHP RFC: Saner string to number comparisons |url=https://wiki.php.net/rfc/string_to_number_comparison |website=wiki.php.net |access-date=14 August 2020}}</ref> saner numeric strings,<ref>{{cite web |title=PHP RFC: Saner numeric strings |url=https://wiki.php.net/rfc/saner-numeric-strings |website=wiki.php.net |access-date=14 August 2020}}</ref> {{code|lang=php|TypeError}} on invalid arithmetic/bitwise operators,<ref>{{cite web |title=PHP RFC: Stricter type checks for arithmetic/bitwise operators |url=https://wiki.php.net/rfc/arithmetic_operator_type_checks |website=wiki.php.net |access-date=14 August 2020}}</ref> reclassification of various engine errors,<ref>{{cite web |title=PHP RFC: Reclassifying engine warnings |url=https://wiki.php.net/rfc/engine_warnings |website=wiki.php.net |access-date=14 August 2020}}</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>), locale-independent float to string conversion,<ref>{{cite web |title=PHP RFC: Locale-independent float to string cast |url=https://wiki.php.net/rfc/locale_independent_float_to_string |website=wiki.php.net |access-date=14 August 2020}}</ref> variable syntax tweaks,<ref>{{cite web |title=PHP RFC: Variable Syntax Tweaks |url=https://wiki.php.net/rfc/variable_syntax_tweaks|website=wiki.php.net |access-date=14 August 2020}}</ref> attributes,<ref>{{cite web |title=PHP RFC: Attributes V2 |url=https://wiki.php.net/rfc/attributes_v2 |website=wiki.php.net |access-date=14 August 2020}}</ref><ref>{{Cite web|title=PHP RFC: Attribute Amendments|url=https://wiki.php.net/rfc/attribute_amendments |website=wiki.php.net |access-date=14 August 2020}}</ref><ref>{{Cite web|title=PHP RFC: Shorter Attribute Syntax|url=https://wiki.php.net/rfc/shorter_attribute_syntax|access-date=2020-06-20|website=wiki.php.net}}</ref><ref>{{cite web |title=PHP RFC: Shorter Attribute Syntax Change |url=https://wiki.php.net/rfc/shorter_attribute_syntax_change |website=wiki.php.net |access-date=14 August 2020}}</ref> named arguments,<ref>{{cite web |title=PHP RFC: Named Arguments |url=https://wiki.php.net/rfc/named_params |website=wiki.php.net |access-date=14 August 2020}}</ref> match expression,<ref>{{cite web |title=PHP RFC: Match expression v2 |url=https://wiki.php.net/rfc/match_expression_v2 |website=wiki.php.net |access-date=14 August 2020}}</ref> constructor property promotion,<ref>{{cite web |title=PHP RFC: Constructor Property Promotion |url=https://wiki.php.net/rfc/constructor_promotion |website=wiki.php.net |access-date=14 August 2020}}</ref> union types,<ref>{{cite web |title=PHP RFC: Union Types 2.0 |url=https://wiki.php.net/rfc/union_types_v2 |website=wiki.php.net |access-date=14 August 2020}}</ref> {{code|lang=php|mixed}} type,<ref>{{cite web |title=PHP RFC: Mixed Type v2 |url=https://wiki.php.net/rfc/mixed_type_v2 |website=wiki.php.net |access-date=14 August 2020}}</ref> static return type,<ref>{{cite web |title=PHP RFC: Static return type |url=https://wiki.php.net/rfc/static_return_type |website=wiki.php.net |access-date=14 August 2020}}</ref> nullsafe operator,<ref name="wiki.php.net">{{cite web |title=PHP RFC: Nullsafe operator |url=https://wiki.php.net/rfc/nullsafe_operator |website=wiki.php.net |access-date=14 August 2020}}</ref> non-capturing catches,<ref>{{cite web |title=PHP RFC: non-capturing catches |url=https://wiki.php.net/rfc/non-capturing_catches |website=wiki.php.net |access-date=14 August 2020}}</ref> {{code|lang=php|throw}} expression,<ref name="wiki.php.net-4">{{cite web |title=PHP RFC: throw expression |url=https://wiki.php.net/rfc/throw_expression |website=wiki.php.net |access-date=14 August 2020}}</ref> JSON extension is always available.<ref name="Andre">{{cite web |last1=Andre |first1=Tyson |title=PHP RFC: Always available JSON extension |url=https://wiki.php.net/rfc/always_enable_json |website=PHP |access-date=25 October 2020}}</ref> |- | {{Version |co | 8.1}} | 25 November 2021<ref>{{Cite web |title=PHP: todo:php81 |url=https://wiki.php.net/todo/php81 |access-date=2022-06-16 |website=wiki.php.net}}</ref> | 31 December 2025 | Explicit octal integer literal notation,<ref>{{Cite web|url=https://wiki.php.net/rfc/explicit_octal_notation|title=PHP RFC: Explicit octal integer literal notation|website=wiki.php.net|access-date=2020-11-25}}</ref> enumerations,<ref>{{Cite web|url=https://wiki.php.net/rfc/enumerations|title=PHP RFC: Enumerations|website=wiki.php.net|access-date=2021-03-25}}</ref> read-only properties,<ref>{{Cite web|title=PHP: rfc:readonly_properties_v2|url=https://wiki.php.net/rfc/readonly_properties_v2|access-date=2021-11-26|website=wiki.php.net}}</ref> first-class callable syntax,<ref>{{Cite web|title=PHP: rfc:first_class_callable_syntax|url=https://wiki.php.net/rfc/first_class_callable_syntax|access-date=2021-11-26|website=wiki.php.net}}</ref> {{code|lang=php|new}} in initializers,<ref>{{Cite web|title=PHP: rfc:new_in_initializers|url=https://wiki.php.net/rfc/new_in_initializers|access-date=2021-11-26|website=wiki.php.net}}</ref> pure intersection types,<ref>{{Cite web|title=PHP: rfc:pure-intersection-types|url=https://wiki.php.net/rfc/pure-intersection-types|access-date=2021-11-26|website=wiki.php.net}}</ref> {{code|lang=php|never}} return type,<ref>{{Cite web|title=PHP: rfc:noreturn_type|url=https://wiki.php.net/rfc/noreturn_type|access-date=2021-11-26|website=wiki.php.net}}</ref> {{code|lang=php|final}} class constraints,<ref>{{Cite web|title=PHP: rfc:final_class_const|url=https://wiki.php.net/rfc/final_class_const|access-date=2021-11-26|website=wiki.php.net}}</ref> fibers<ref>{{Cite web|title=PHP: rfc:fibers|url=https://wiki.php.net/rfc/fibers|access-date=2021-11-26|website=wiki.php.net}}</ref> |- | {{Version |co |8.2}} | 8 December 2022<ref>{{Cite web |title=PHP: todo:php82 |url=https://wiki.php.net/todo/php82 |access-date=2022-06-16 |website=wiki.php.net}}</ref> | 31 December 2026 | Readonly classes,<ref>{{Cite web |title=PHP: rfc:readonly_classes |url=https://wiki.php.net/rfc/readonly_classes |access-date=2022-06-16 |website=wiki.php.net}}</ref> {{code|lang=php|code=null}}, {{code|lang=php|code=false}}, and {{code|lang=php|code=true}} as stand-alone types,<ref>{{Cite web |title=PHP: rfc:null-false-standalone-types |url=https://wiki.php.net/rfc/null-false-standalone-types |access-date=2022-06-16 |website=wiki.php.net}}</ref><ref>{{Cite web |title=PHP: rfc:true-type |url=https://wiki.php.net/rfc/true-type |access-date=2022-06-16 |website=wiki.php.net}}</ref> locale-independent case conversion,<ref>{{Cite web |title=PHP: rfc:strtolower-ascii |url=https://wiki.php.net/rfc/strtolower-ascii |access-date=2022-06-16 |website=wiki.php.net}}</ref> disjunctive normal form types,<ref>{{Cite web |title=PHP: rfc:dnf_types |url=https://wiki.php.net/rfc/dnf_types |access-date=2023-02-07 |website=wiki.php.net}}</ref> constants in traits<ref>{{Cite web |title=PHP: rfc:constants_in_traits |url=https://wiki.php.net/rfc/constants_in_traits |access-date=2023-02-07 |website=wiki.php.net}}</ref> |- | {{Version |co | 8.3}} | 23 November 2023<ref>{{Cite web |date=23 November 2023 |title=PHP 8.3.0 Released! |url=https://www.php.net/archive/2023.php#2023-11-23-2 |access-date=24 November 2023 |website=php.net}}</ref> | 31 December 2027 | Typed class constants,<ref>{{Cite web |title=PHP: rfc:typed_class_constants |url=https://wiki.php.net/rfc/typed_class_constants |access-date=2023-12-17 |website=wiki.php.net}}</ref> dynamic class constant fetch,<ref>{{Cite web |title=PHP: rfc:dynamic_class_constant_fetch |url=https://wiki.php.net/rfc/dynamic_class_constant_fetch |access-date=2023-12-17 |website=wiki.php.net}}</ref> {{code|lang=php|code=#[\Override]}} attribute,<ref>{{Cite web |title=PHP: rfc:marking_overriden_methods |url=https://wiki.php.net/rfc/marking_overriden_methods |access-date=2023-12-17 |website=wiki.php.net}}</ref> deep-cloning of read-only properties,<ref>{{Cite web |title=PHP: rfc:readonly_amendments |url=https://wiki.php.net/rfc/readonly_amendments |access-date=2023-12-17 |website=wiki.php.net}}</ref> new {{code|lang=php|code=json_validate}} function,<ref>{{Cite web |title=PHP: rfc:json_validate |url=https://wiki.php.net/rfc/json_validate |access-date=2023-12-17 |website=wiki.php.net}}</ref> randomizer additions,<ref>{{Cite web |title=PHP: rfc:randomizer_additions |url=https://wiki.php.net/rfc/randomizer_additions |access-date=2023-12-17 |website=wiki.php.net}}</ref> the command-line linter supports multiple files |- | {{Version |c | 8.4}} | 21 November 2024<ref>{{Cite web |date=26 March 2024 |title=PHP: todo: php84|url=https://wiki.php.net/todo/php84 |access-date=26 March 2024 |website=php.net}}</ref> | 31 December 2028 | Property hooks, asymmetric visibility, an updated DOM API, performance improvements, bug fixes, and general cleanup. |- | {{Version |p | 8.5}} | 20 November 2025<ref>{{Cite web |date=16 April 2024 |title=PHP: todo: php85|url=https://wiki.php.net/todo/php85 |access-date=16 April 2025 |website=php.net}}</ref> | 31 December 2029 | - |- |- class="sortbottom" | colspan="4" | {{Version |l |show=111101}} |} Beginning on 28 June 2011, the PHP Development Team implemented a timeline for the release of new versions of PHP.<ref name="PHP-2011">{{cite web|title=PHP: Release Process|url=https://wiki.php.net/rfc/releaseprocess|access-date=2013-10-06|date=2011-06-20}}</ref> Under this system, at least one release should occur every month. Once per year, a minor release should occur which may include new features. Every minor release should at least be supported for two years with security and bug fixes, followed by at least one year of only security fixes, for a total of a three-year release process for every minor release. No new features, unless small and self-contained, are to be introduced into a minor release during the three-year release process.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)