Anonymous (class)es

Examples: Support for anonymous classes was added in PHP 7. Anonymous classes are useful when simple, one-off objects need to be created. <?php // Pre PHP 7 code class Logger {     public function log($msg)     {         echo $msg;     } } $util->setLogger(new Logger()); // PHP 7+ code $util->setLogger(new class {     public function log($msg)     {         echo $msg;     } }); The above example will output: They can pass argu

PharData::compressFiles

(PHP >= 5.3.0, PECL phar >= 2.0.0) Compresses all files in the current tar/zip archive bool PharData::compressFiles ( int $compression ) For tar-based archives, this method throws a BadMethodCallException, as compression of individual files within a tar archive is not supported by the file format. Use PharData::compress() to compress an entire tar-based archive. For Zip-based archives, this method compresses all file

IntlCalendar::fromDateTime

(PHP 5.5.0, PHP 7, PECL >= 3.0.0a2) Create an IntlCalendar from a DateTime object or string public static IntlCalendar IntlCalendar::fromDateTime ( mixed $dateTime ) Object oriented style Procedural style IntlCalendar intlcal_from_date_time ( mixed $dateTime ) Creates an IntlCalendar object either from a DateTime object or from a string from which a DateTime object can be built. The new calendar will represent not

session_register_shutdown

(PHP >=5.4.0) Session shutdown function void session_register_shutdown ( void ) Registers session_write_close() as a shutdown function. Returns: No value is returned. Exception: Emits E_WARNING if registering the shutdown function fails.

gupnp_service_freeze_notify

(PECL gupnp >= 0.1.0) Freeze new notifications bool gupnp_service_freeze_notify ( resource $service ) Causes new notifications to be queued up until gupnp_service_thaw_notify() is called. Parameters: service A service identifier. Returns: Returns TRUE on success or FALSE on failure.

gregoriantojd

(PHP 4, PHP 5, PHP 7) Converts a Gregorian date to Julian Day Count int gregoriantojd ( int $month, int $day, int $year ) Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D. Although this function can handle dates all the way back to 4714 B.C., such use may not be meaningful. The Gregorian calendar was not instituted until October 15, 1582 (or October 5, 1582 in the Julian calendar). Some countries did not accept it u

SessionHandlerInterface::read

(PHP 5 >= 5.4.0, PHP 7) Read session data abstract public string SessionHandlerInterface::read ( string $session_id ) Reads the session data from the session storage, and returns the results. Called right after the session starts or when session_start() is called. Please note that before this method is called SessionHandlerInterface::open() is invoked. This method is called by PHP itself when the session is started. Thi

Thread::getCurrentThreadId

(PECL pthreads >= 2.0.0) Identification public static integer Thread::getCurrentThreadId ( void ) Will return the identity of the currently executing Thread Returns: A numeric identity Examples: Return the identity of the currently executing Thread <?php class My extends Thread {     public function run() {         

newt_checkbox_set_flags

(PECL newt >= 0.1) Configures checkbox resource void newt_checkbox_set_flags ( resource $checkbox, int $flags, int $sense ) This function allows to set various flags on checkbox resource. Parameters: checkbox This function allows to set various flags on checkbox resource. flags This function allows to set various flags on checkbox r

md5

(PHP 4, PHP 5, PHP 7) Calculate the md5 hash of a string string md5 ( string $str [, bool $raw_output = false ] ) Calculates the MD5 hash of str using the » RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash. Parameters: str The string. raw_output If the optional raw_output is set to TRUE, then the md5 digest i