Downloads
Documentation
Get Involved
Help
Search docs
Getting Started
Introduction
A simple tutorial
Language Reference
Basic syntax
Types
Variables
Constants
Expressions
Operators
Control Structures
Functions
Classes and Objects
Namespaces
Exceptions
Generators
References Explained
Predefined Variables
Predefined Exceptions
Predefined Interfaces and Classes
Context options and parameters
Supported Protocols and Wrappers
Security
Introduction
General considerations
Installed as CGI binary
Installed as an Apache module
Filesystem Security
Database Security
Error Reporting
Using Register Globals
User Submitted Data
Magic Quotes
Hiding PHP
Keeping Current
Features
HTTP authentication with PHP
Cookies
Sessions
Dealing with XForms
Handling file uploads
Using remote files
Connection handling
Persistent Database Connections
Safe Mode
Command line usage
Garbage Collection
DTrace Dynamic Tracing
Function Reference
Affecting PHP's Behaviour
Audio Formats Manipulation
Authentication Services
Command Line Specific Extensions
Compression and Archive Extensions
Credit Card Processing
Cryptography Extensions
Database Extensions
Date and Time Related Extensions
File System Related Extensions
Human Language and Character Encoding Support
Image Processing and Generation
Mail Related Extensions
Mathematical Extensions
Non-Text MIME Output
Process Control Extensions
Other Basic Extensions
Other Services
Search Engine Extensions
Server Specific Extensions
Session Extensions
Text Processing
Variable and Type Related Extensions
Web Services
Windows Only Extensions
XML Manipulation
Keyboard Shortcuts
?
This help
j
Next menu item
k
Previous menu item
g p
Previous man page
g n
Next man page
G
Scroll to bottom
g g
Scroll to top
g h
Goto homepage
g s
Goto search
(current page)
/
Focus search box
Fast & Modern
PHP provides blistering fast performance and a modern developer-focused experience.
A Massive Ecosystem
Leverage over 450,000 existing open source packages for your projects, along with powerful tooling.
An Established Community
Millions of developers and businesses already use PHP to achieve their goals every day.
Try It Now
Begin writing PHP code immediately within a browser-based sandbox. No install required.
Launch Sandbox
Why Use PHP?
Learn why PHP powers the global web - from individual blogs to enormous enterprises.
Discover Why
Learn
Browse the documentation, including extensive tutorials and guidance.
Browse Docs
Releases
View currently supported PHP runtimes including download logs and highlight features.
View Runtimes
Community
Get involved with the PHP Community via forums, live chat and conferences.
Get Engaged
Language Development
See how the PHP language works to evolve, and maybe even get involved yourself!
Find Out More
8.5.7
·
Migration Guide
Bugfixes:
2027-12-31
Security:
2029-12-31
Find Out More About PHP 8.5
Download Now
Major Features
URI Extension
PHP 8.5 adds a built-in URI extension to parse, normalize, and handle URLs following RFC 3986 and WHATWG URL standards.
Pipe Operator
The |> operator enables chaining callables left-to-right, passing values smoothly through multiple functions without intermediary variables.
Clone With
Clone objects and update properties with the new clone() syntax, making the "with-er" pattern simple for readonly classes.
#[\NoDiscard] Attribute
The #[\NoDiscard] attribute warns when a return value isn’t used, helping prevent mistakes and improving overall API safety.
Closures and First-Class Callables in Constant Expressions
Static closures and first-class callables can now be used in constant expressions, such as attribute parameters.
Persistent cURL Share Handles
Handles can now be persisted across multiple PHP requests, avoiding the cost of repeated connection initialization to the same hosts.
8.4.22
·
Migration Guide
Bugfixes:
2026-12-31
Security:
2028-12-31
Major Features:
Property Hooks allow intercepting properties
Asymmetric Visibility for get and set
#[Depreciated] attribute signals removal intent
New array lookup and query options
Discover More
Download
8.3.31
·
Migration Guide
Bugfixes:
End of Life
Security:
2027-12-31
Major Features:
Class constants can now be typed
Dynamic Class Constants
Enhanced deep cloning of readonly instances
Generate random strings from provided character sets
Discover More
Download
8.2.31
·
Migration Guide
Bugfixes:
End of Life
Security:
2026-12-31
Major Features:
Entire classes can now be marked Readonly
Improved type support with Disjunction Normal Forms
Null, true and false are now usable as types
Discover More
Download
The PHP Foundation is a collective of people and organizations, united in the mission to ensure the long-term prosperity of the PHP language.
Learn About the PHP Foundation
·
Donate Via Open Collective
·
Donate Via GitHub
The PHP Foundation is grateful for our many sponsors, including:
Community
Reddit
Reddit has an active PHP community discussing the language and its ecosystem.
Visit Community
"PHP Community" Discord
Join thousands of users on Discord talking about PHP.
Visit Community
Official Mailing Lists
Help and guidance, as well as proposals & discussions on the future of the language.
Visit Community
"PHP Developers" Discord
Born in 2018, it is the first community on Discord dedicated to PHP developers. Open for both experts and apprentices.
Visit Community
Events & Conferences
Laracon US 2026
Explore Event
Longhorn PHP 2026 - Call For Papers
Explore Event
Laravel Live Denmark 2026
Explore Event
International PHP Conference Berlin 2026
Explore Event
PHP has one of the largest collections of open-source libraries in the world.
Ranging from individual helpers to entire application frameworks, all packages are easily installable via the
Composer
package manager.
Get Composer
·
Browse Package Repository
Language Development
PHP on Github
Browse and contribute to the source code behind the PHP engine and infrastructure.
Visit GitHub
RFCs / Language Proposals
Requests for Comments are the mechanism PHP internals uses to propose language changes.
View Proposals
PHP Internals
Browse discussions from PHP Internals mailing list about current and future enhancements.
Browse Mailing List
Get Involved
Find ways to contribute to the PHP engine, documentation and more.
Get Involved
Submit a Bug Report
Found a bug in the PHP runtime? Help us out by submitting it to our issue tracker.
Browse & Submit Issues
Documentation Translation
Help our team translate our documentation into multiple languages.
Learn About Translation
PHP
My PHP.net
Downloads
Contact
Other PHP.net sites
Learn
Documentation
Get Involved
Help
The PHP Foundation
About the Foundation
Sponsor
Contact
Legal
Privacy Policy
↑
and
↓
to navigate •
Enter
to select •
Esc
to close •
/
to open
Press
Enter
without selection to search using Google