Extension Methods
DraftLets code add methods to existing classes and interfaces from outside their definition, Swift-style.
Last activity
Follow the proposals shaping the next version of PHP.
Lets code add methods to existing classes and interfaces from outside their definition, Swift-style.
Last activity
Extends extension methods to built-in types like string, int and array.
Last activity
Throws a catchable MemoryError for allocations that are obviously too large, instead of a fatal error.
Last activity
Adds str_mask() for masking phone numbers, card numbers and other sensitive strings.
Last activity
Last activity
Adds ReflectionAttribute::getCurrent() so an attribute can find the element it is attached to.
Last activity
Adds a fallthrough; marker to switch and warns when a non-empty case falls through to the next one without it.
Last activity
Adds path segment accessors to the URI extension so paths no longer need splitting by hand.
Last activity
Adds a #[\NonExhaustive] attribute that marks an enum as likely to gain cases, so code matching on it knows to handle unknown ones.
Last activity
Adds str_iter() for iterating over a string one UTF-8 code point at a time.
Last activity
Adds FILTER_VALIDATE_STRLEN to validate string length in UTF-8 code points.
Last activity
Adds a SORT_STRICT flag to sort(), ksort(), array_unique() and friends that orders values by type first, with no type juggling.
Last activity
Lets __sleep() return null or nothing, so it runs as a pre-serialization hook and the engine then serializes the object as usual.
Last activity
Adds a #[\NotSerializable] attribute that makes the engine refuse to serialize() or unserialize() instances of a class.
Last activity
Adds BLAKE3 to ext/hash, so hash('blake3', ...) and hash_hmac() can use it.
Last activity
Adds array_search_range() to search for a value within a slice of an array.
Last activity
Adds a |>= operator so $x |>= trim(...) pipes a variable through a function and assigns the result back.
Last activity
Function autoloading modeled on class autoloading, with no cost to calls that resolve normally.
Last activity
Requires autoconf 2.71 to build PHP 8.6 from git, and MySQL 5.7.3 or MariaDB 10.2.4 for persistent connections.
Last activity
Lets readonly properties declare default values, so a class can meet a get-only interface property with a fixed value.
Last activity