PHP is an open supply general-purpose server-side scripting language initially designed for Net growth to supply dynamic Net pages. It is likely one of the first developed server-side scripting languages to be embedded into an HTML supply doc slightly than calling an exterior file to course of information. The code is interpreted by a Net server with a PHP processor module which generates the ensuing Net web page. It additionally has developed to incorporate a command-line interface functionality and can be utilized in standalone graphical functions.
If you’re new to PHP and wish to get some thought of the way it works, strive the introductory tutorial.
After that, take a look at the on-line handbook.
What’s New
PHP 8.4 is a serious replace of the PHP language. It comprises many new options, similar to property hooks, uneven visibility, an up to date DOM API, efficiency enhancements, bug fixes, and basic cleanup.
This launch marks the most recent minor launch of the PHP language.
PHP 8.4 comes with quite a few enhancements and new options similar to:
- Property Hooks
- Uneven Property Visibility
- Lazy Objects
- PDO driver-specific subclasses
- BCMath object kind
- And far far more…
BcMath:
- [RFC] Add bcfloor, bcceil and bcround to BCMath.
- Enhance efficiency.
- Modify bcround()’s $mode parameter to solely settle for the RoundingMode enum.
- Fastened LONG_MAX in BCMath ext.
- Fastened bcdiv() div by one.
- [RFC] Help object varieties in BCMath.
- bcpow() efficiency enchancment.
- ext/bcmath: Verify for scale overflow.
- [RFC] ext/bcmath: Added bcdivmod.
- Repair GH-15968 (Keep away from changing objects to strings in operator calculations).
- Fastened bug GH-16265 (Added early return case when result’s 0) (Saki Takamachi).
- Fastened bug GH-16262 (Fastened a bug the place size_t underflows) (Saki Takamachi).
- Fastened GH-16236 (Fastened a bug in BcMathNumber::pow() and bcpow() when elevating damaging powers of 0) (Saki Takamachi).
Core:
- Added zend_call_stack_get implementation for NetBSD, DragonFlyBSD, Solaris and Haiku.
- Enabled ifunc checks on FreeBSD from the 12.x releases.
- Modified the kind of PHP_DEBUG and PHP_ZTS constants to bool.
- Fastened bug GH-13142 (Undefined variable title is shortened when comprises ).
- Fastened bug GH-13178 (Iterator positions incorrect when changing packed array to hashed).
- Fastened zend fiber construct for solaris default mode (32 bits).
- Fastened zend name stack measurement for macOs/arm64.
- Added assist for Zend Max Execution Timers on FreeBSD.
- Guarantee fiber stack shouldn’t be backed by THP.
- Implement GH-13609 (Dump wrapped object in WeakReference class).
- Added sparc64 arch meeting assist for zend fiber.
- Fastened GH-13581 no area out there for TLS on NetBSD.
- Added fiber Sys-V loongarch64 assist.
- Adjusted closure names to incorporate the father or mother operate’s title.
- Enhance randomness of uploaded file names and recordsdata created by tempnam().
- Added gc and shutdown callbacks to zend_mm customized handlers.
- Fastened bug GH-14650 (Compute the dimensions of pages earlier than allocating reminiscence).
- Fastened bug GH-11928 (The –enable-re2c-cgoto does not add the -g flag).
- Added the #[Deprecated] attribute.
- Fastened GH-11389 (Permit suspending fibers in destructors).
- Fastened bug GH-14801 (Repair construct for armv7).
- Carried out property hooks RFC.
- Repair GH-14978 (The xmlreader extension phpize construct).
- Throw Error exception when encountering recursion throughout comparability, slightly than deadly error.
- Added lacking cstddef embody for C++ builds.
- Up to date construct system scripts config.guess to 2024-07-27 and config.sub to 2024-05-27.
- Fastened bug GH-15240 (Infinite recursion in trait hook).
- Fastened bug GH-15140 (Lacking variance examine for summary set with uneven kind).
- Fastened bug GH-15181 (Disabled output handler is flushed once more).
- Passing E_USER_ERROR to trigger_error() is now deprecated.
- Fastened bug GH-15292 (Dynamic AVX detection is damaged for MSVC).
- Utilizing “_” as a category title is now deprecated.
- Exiting a namespace now clears seen symbols.
- The exit (and die) language constructs now behave extra like a operate. They are often handed appreciated callables, are affected by the strict_types declare assertion, and now carry out the same old kind coercions as a substitute of casting any non-integer worth to a string. As such, passing invalid varieties to exit/die could now lead to a TypeError being thrown.
- Fastened bug GH-15438 (Hooks on constructor promoted properties with out visibility are ignored).
- Fastened bug GH-15419 (Lacking readonly+hook incompatibility examine for readonly lessons).
- Fastened bug GH-15187 (Varied hooked object iterator points).
- Fastened bug GH-15456 (Crash in get_class_vars() on digital properties).
- Fastened bug GH-15501 (Home windows HAVE_
_H macros outlined to 1 or undefined). - Carried out uneven visibility for properties.
- Fastened bug GH-15644 (Uneven visibility does not work with hooks).
- Carried out lazy objects RFC.
- Fastened bug GH-15686 (Constructing shared iconv with exterior iconv library).
- Fastened lacking error when including uneven visibility to unilateral digital property.
- Fastened bug GH-15693 (Pointless embody in fundamental.c bloats binary).
- Fastened bug GH-15731 (AllowDynamicProperties validation ought to error on enums).
- Fastened bug GH-16040 (Use-after-free of object launched in hook).
- Fastened bug GH-16026 (Reuse of dtor fiber throughout shutdown).
- Fastened bug GH-15999 (zend_std_write_property() assertion failure with lazy objects).
- Fastened bug GH-15960 (Foreach edge circumstances with lazy objects).
- Fastened bug GH-16185 (Varied hooked object iterator points).
- Fastened bug OSS-Fuzz #371445205 (Heap-use-after-free in attr_free).
- Fastened lacking error when including uneven visibility to static properties.
- Fastened bug OSS-Fuzz #71407 (Null-dereference WRITE in zend_lazy_object_clone).
- Fastened bug GH-16574 (Incorrect error “undefined methodology” messages).
- Fastened bug GH-16577 (EG(strtod_state).freelist leaks with opcache.preload).
- Fastened bug GH-16615 (Assertion failure in zend_std_read_property).
- Fastened bug GH-16342 (Added ReflectionProperty::isLazy()).
- Fastened bug GH-16725 (Incorrect entry examine for non-hooked props in hooked object iterator).
Curl:
- Deprecated the CURLOPT_BINARYTRANSFER fixed.
- Bumped required libcurl model to 7.61.0.
- Added feature_list key to the curl_version() return worth.
- Added constants CURL_HTTP_VERSION_3 (libcurl 7.66) and CURL_HTTP_VERSION_3ONLY (libcurl 7.88) as choices for CURLOPT_HTTP_VERSION (Ayesh Karunaratne)
- Added CURLOPT_TCP_KEEPCNT to set the variety of probes to ship earlier than dropping the connection.
- Added CURLOPT_PREREQFUNCTION Curl choice to set a customized callback after the connection is established, however earlier than the request is carried out.
- Added CURLOPT_SERVER_RESPONSE_TIMEOUT, which was previously often called CURLOPT_FTP_RESPONSE_TIMEOUT.
- The CURLOPT_DNS_USE_GLOBAL_CACHE choice is now silently ignored.
- Added CURLOPT_DEBUGFUNCTION as a Curl choice.
- Fastened bug GH-16359 (crash with curl_setopt* CURLOPT_WRITEFUNCTION with out null callback).
- Fastened bug GH-16723 (CURLMOPT_PUSHFUNCTION points).
Date:
- Added DateTime[Immutable]::createFromTimestamp.
- Added DateTime[Immutable]::[get|set]Microsecond.
- Constants SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, and SUNFUNCS_RET_DOUBLE at the moment are deprecated.
- Fastened bug GH-13773 (DatePeriod not bearing in mind microseconds for finish date).
DBA:
- Passing null or false to dba_key_split() is deprecated.
Debugging:
- Fastened bug GH-15923 (GDB: Python Exception
: exceptions should derive from BaseException).
DOM:
- Added DOMNode::compareDocumentPosition().
- Implement #53655 (Enhance pace of DOMNode::C14N() on massive XML paperwork).
- Repair cloning attribute with namespace disappearing namespace.
- Implement DOM HTML5 parsing and serialization RFC.
- Repair DOMElement->prefix with empty string creates bogus prefix.
- Deal with OOM extra constantly.
- Carried out “Enhance callbacks in ext/dom and ext/xsl” RFC.
- Added DOMXPath::quote() static methodology.
- Carried out opt-in ext/dom spec compliance RFC.
- Fastened bug #79701 (getElementById doesn’t appropriately work with duplicate definitions).
- Carried out “New ext-dom options in PHP 8.4” RFC.
- Fastened GH-14698 (segfault on DOM node dereference).
- Enhance assist for template components.
- Repair trampoline leak in xpath callables.
- Throw as a substitute of silently failing when making a too lengthy textual content node in (DOM)ParentNode and (DOM)ChildNode.
- Fastened bug GH-15192 (Segmentation fault in dom extension (html5_serializer)).
- Deprecated DOM_PHP_ERR fixed.
- Eliminated DOMImplementation::getFeature().
- Fastened bug GH-15331 (Aspect::$substitutedNodeValue take a look at failed).
- Fastened bug GH-15570 (Segmentation fault (entry null pointer) in ext/dom/html5_serializer.c).
- Fastened bug GH-13988 (Storing DOMElement devour 4 instances extra reminiscence in PHP 8.1 than in PHP 8.0).
- Repair XML serializer errata: xmlns=”” serialization must be allowed.
- Fastened bug GH-15910 (Assertion failure in ext/dom/ingredient.c).
- Repair unsetting DOM properties.
- Fastened bug GH-16190 (Utilizing reflection to name DomNode::__construct causes assertion failure).
- Repair edge-case in DOM parsing decoding.
- Fastened bug GH-16465 (Heap buffer overflow in DOMNode->getElementByTagName).
- Fastened bug GH-16594 (Assertion failure in DOM -> earlier than).
Learn the entire launch notes right here.