In PHP, a constant can hold an object since PHP 8.1, when the new keyword became available in initializers. Reading a property of such an object was allowed, but writing...
In PHP, the ZipArchive class creates and reads ZIP archives. The archive always had to be a file on disk, because ZipArchive::open takes a path. Building an archive to send...
In PHP, the mbstring extension provides its own set of regular expression functions, known as mbregex. They are built on the Oniguruma library and work independently of the PCRE functions...
In PHP, the finfo_file function returns information about a file, such as its MIME type. The function accepted local paths only. Passing a URL returned false, so determining the type...
In PHP, the http_build_query function generates a URL-encoded query string from an array. The function also accepts an object, in which case its properties are treated as array elements. Objects...
In PHP, the spl_classes function returns an array which contains the names of the classes and interfaces provided by the SPL extension. Each key in the array is identical to...
The spl_object_hash function returns a 32 character string which identifies an object. This string is commonly used as an array key, which makes it possible to track objects in a...
In PHP, __construct initializes an object, while __destruct cleans it up. Neither method can have a return type, and any value they return is ignored. The new keyword always returns...
In PHP, the metaphone function encodes a word into a phonetic code which represents how that word sounds in English. Words which are spelled differently but pronounced alike receive the...