PHP 8.1
New Functions
PHP Core
Process Control
Standard
Sodium
XChaCha20
Ristretto255
Ristretto255 functions are available as of libsodium 1.0.18.
- sodium_crypto_core_ristretto255_add()
- sodium_crypto_core_ristretto255_from_hash()
- sodium_crypto_core_ristretto255_is_valid_point()
- sodium_crypto_core_ristretto255_random()
- sodium_crypto_core_ristretto255_scalar_add()
- sodium_crypto_core_ristretto255_scalar_complement()
- sodium_crypto_core_ristretto255_scalar_invert()
- sodium_crypto_core_ristretto255_scalar_mul()
- sodium_crypto_core_ristretto255_scalar_negate()
- sodium_crypto_core_ristretto255_scalar_random()
- sodium_crypto_core_ristretto255_scalar_reduce()
- sodium_crypto_core_ristretto255_scalar_sub()
- sodium_crypto_core_ristretto255_sub()
- sodium_crypto_scalarmult_ristretto255()
- sodium_crypto_scalarmult_ristretto255_base()
PHP 7.4
New Functions
Multibyte String
OpenSSL
Process Control
PHP 7.3
New Functions
PHP Core
FastCGI Process Manager
Date and Time
GNU Multiple Precision
Internationalization Functions
- Normalizer::getRawDecomposition()
- normalizer_get_raw_decomposition()
- Spoofchecker::setRestrictionLevel()
Lightweight Directory Access Protocol
OpenSSL
PHP 7.2
New functions
Sodium
- sodium_add()
- sodium_bin2hex()
- sodium_compare()
- sodium_crypto_aead_aes256gcm_decrypt()
- sodium_crypto_aead_aes256gcm_encrypt()
- sodium_crypto_aead_aes256gcm_is_available()
- sodium_crypto_aead_aes256gcm_keygen()
- sodium_crypto_aead_chacha20poly1305_decrypt()
- sodium_crypto_aead_chacha20poly1305_encrypt()
- sodium_crypto_aead_chacha20poly1305_ietf_decrypt()
- sodium_crypto_aead_chacha20poly1305_ietf_encrypt()
- sodium_crypto_aead_chacha20poly1305_ietf_keygen()
- sodium_crypto_aead_chacha20poly1305_keygen()
- sodium_crypto_auth_keygen()
- sodium_crypto_auth_verify()
- sodium_crypto_auth()
- sodium_crypto_box_keypair_from_secretkey_and_publickey()
- sodium_crypto_box_keypair()
- sodium_crypto_box_open()
- sodium_crypto_box_publickey_from_secretkey()
- sodium_crypto_box_publickey()
- sodium_crypto_box_seal_open()
- sodium_crypto_box_seal()
- sodium_crypto_box_secretkey()
- sodium_crypto_box_seed_keypair()
- sodium_crypto_box()
- sodium_crypto_generichash_final()
- sodium_crypto_generichash_init()
- sodium_crypto_generichash_keygen()
- sodium_crypto_generichash_update()
- sodium_crypto_generichash()
- sodium_crypto_kdf_derive_from_key()
- sodium_crypto_kdf_keygen()
- sodium_crypto_kx_client_session_keys()
- sodium_crypto_kx_keypair()
- sodium_crypto_kx_publickey()
- sodium_crypto_kx_secretkey()
- sodium_crypto_kx_seed_keypair()
- sodium_crypto_kx_server_session_keys()
- sodium_crypto_pwhash_scryptsalsa208sha256_str_verify()
- sodium_crypto_pwhash_scryptsalsa208sha256_str()
- sodium_crypto_pwhash_scryptsalsa208sha256()
- sodium_crypto_pwhash_str_verify()
- sodium_crypto_pwhash_str()
- sodium_crypto_pwhash()
- sodium_crypto_scalarmult_base()
- sodium_crypto_scalarmult()
- sodium_crypto_secretbox_keygen()
- sodium_crypto_secretbox_open()
- sodium_crypto_secretbox()
- sodium_crypto_shorthash_keygen()
- sodium_crypto_shorthash()
- sodium_crypto_sign_detached()
- sodium_crypto_sign_ed25519_pk_to_curve25519()
- sodium_crypto_sign_ed25519_sk_to_curve25519()
- sodium_crypto_sign_keypair_from_secretkey_and_publickey()
- sodium_crypto_sign_keypair()
- sodium_crypto_sign_open()
- sodium_crypto_sign_publickey_from_secretkey()
- sodium_crypto_sign_publickey()
- sodium_crypto_sign_secretkey()
- sodium_crypto_sign_seed_keypair()
- sodium_crypto_sign_verify_detached()
- sodium_crypto_sign()
- sodium_crypto_stream_keygen()
- sodium_crypto_stream_xor()
- sodium_crypto_stream()
- sodium_hex2bin()
- sodium_increment()
- sodium_memcmp()
- sodium_memzero()
- sodium_pad()
- sodium_unpad()
PHP 7.1
New functions
PHP Core
PHP 7.0
PHP 5.6
New functions
PHP 5.5
New Functions
PHP Core
Intl
- datefmt_format_object()
- datefmt_get_calendar_object()
- datefmt_get_timezone()
- datefmt_set_timezone()
- datefmt_get_calendar_object()
- intlcal_create_instance()
- intlcal_get_keyword_values_for_locale()
- intlcal_get_now()
- intlcal_get_available_locales()
- intlcal_get()
- intlcal_get_time()
- intlcal_set_time()
- intlcal_add()
- intlcal_set_time_zone()
- intlcal_after()
- intlcal_before()
- intlcal_set()
- intlcal_roll()
- intlcal_clear()
- intlcal_field_difference()
- intlcal_get_actual_maximum()
- intlcal_get_actual_minimum()
- intlcal_get_day_of_week_type()
- intlcal_get_first_day_of_week()
- intlcal_get_greatest_minimum()
- intlcal_get_least_maximum()
- intlcal_get_locale()
- intlcal_get_maximum()
- intlcal_get_minimal_days_in_first_week()
- intlcal_get_minimum()
- intlcal_get_time_zone()
- intlcal_get_type()
- intlcal_get_weekend_transition()
- intlcal_in_daylight_time()
- intlcal_is_equivalent_to()
- intlcal_is_lenient()
- intlcal_is_set()
- intlcal_is_weekend()
- intlcal_set_first_day_of_week()
- intlcal_set_lenient()
- intlcal_equals()
- intlcal_get_repeated_wall_time_option()
- intlcal_get_skipped_wall_time_option()
- intlcal_set_repeated_wall_time_option()
- intlcal_set_skipped_wall_time_option()
- intlcal_from_date_time()
- intlcal_to_date_time()
- intlcal_get_error_code()
- intlcal_get_error_message()
- intlgregcal_create_instance()
- intlgregcal_set_gregorian_change()
- intlgregcal_get_gregorian_change()
- intlgregcal_is_leap_year()
- intltz_create_time_zone()
- intltz_create_default()
- intltz_get_id()
- intltz_get_gmt()
- intltz_get_unknown()
- intltz_create_enumeration()
- intltz_count_equivalent_ids()
- intltz_create_time_zone_id_enumeration()
- intltz_get_canonical_id()
- intltz_get_region()
- intltz_get_tz_data_version()
- intltz_get_equivalent_id()
- intltz_use_daylight_time()
- intltz_get_offset()
- intltz_get_raw_offset()
- intltz_has_same_rules()
- intltz_get_display_name()
- intltz_get_dst_savings()
- intltz_from_date_time_zone()
- intltz_to_date_time_zone()
- intltz_get_error_code()
- intltz_get_error_message()
PHP 5.4
New Functions
PHP 5.4 introduced some new functions:
PHP Core:
- hex2bin()
- http_response_code()
- get_declared_traits()
- getimagesizefromstring()
- stream_set_chunk_size()
- socket_import_stream()
- trait_exists()
- header_register_callback()
PHP 5.3
New Functions
PHP 5.3 introduced some new functions:
PHP Core:
- array_replace() - Replaces elements from passed arrays into one array.
- array_replace_recursive() - Recursively replaces elements from passed arrays into one array.
- class_alias() - Creates an alias for a user defined class.
- forward_static_call() - Call a user function from a method context.
- forward_static_call_array() - Call a user function from a method context, with the arguments contained in an array.
- gc_collect_cycles() - Forces collection of any existing garbage cycles.
- gc_disable() - Deactivates the circular reference collector.
- gc_enable() - Activates the circular reference collector.
- gc_enabled() - Returns the status of the circular reference collector.
- get_called_class() - Return the name of the class a static method is called in.
- gethostname() - Return the current host name for the local machine.
- header_remove() - Removes an HTTP header previously set using the header() function.
- lcfirst() - Make a string's first character lowercase.
- parse_ini_string() - Parse a configuration string.
- quoted_printable_encode() - Convert an 8 bit string to a quoted-printable string.
- str_getcsv() - Parse a CSV string into an array.
- stream_context_set_default() - Set the default stream context.
-
stream_supports_lock()
- Return
TRUE
if the stream supports locking. - stream_context_get_params() - Retrieve parameters from a stream context.
- streamWrapper::stream_cast() - Retrieve the underlying stream resource.
- streamWrapper::stream_set_option() - Change stream options
- date_add() - Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object.
- date_create_from_format() - Returns a new DateTime object formatted according to the given format.
- date_diff() - Returns the difference between two DateTime objects.
- date_get_last_errors() - Returns the warnings and errors from the last date/time operation.
- date_parse_from_format() - Get information about a given date.
- date_sub() - Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object.
- timezone_version_get() - Returns the version of the timezonedb.
GMP:
- gmp_testbit() - Tests whether a bit is set.
Hash:
- hash_copy() - Copy hashing context.
IMAP:
- imap_gc() - Clears IMAP cache.
- imap_utf8_to_mutf7() - Encode a UTF-8 string to modified UTF-7.
- imap_mutf7_to_utf8() - Decode a modified UTF-7 string to UTF-8.
JSON:
- json_last_error() - Returns the last JSON error that occurred.
- mysqli_fetch_all() - Fetches all result rows as an associative array, a numeric array, or both.
- mysqli_get_connection_stats() - Returns statistics about the client connection.
- mysqli_poll() - Poll connections.
- mysqli_reap_async_query() - Get result from async query.
- openssl_random_pseudo_bytes() - Returns a string of the given length specified, filled with pseudo-random bytes.
- pcntl_signal_dispatch() - Calls signal handlers for pending signals.
- pcntl_sigprocmask() - Sets and retrieves blocked signals.
- pcntl_sigtimedwait() - Wait for signals with a timeout.
- pcntl_sigwaitinfo() - Wait for signals.
PCRE:
- preg_filter() - Perform a regular expression search and replace, returning only results which matched the pattern.
- msg_queue_exists() - Check whether a message queue exists.
- shm_has_var() - Checks whether a specific key exists inside a shared memory segment.
The following functions are now natively implemented, making them available on all operating systems which can run PHP:
PHP 5.2
New Functions
PHP 5.2.x introduced some new functions:
PHP Core:
-
array_fill_keys()
- Create an array using the elements of the first parameter as keys,
each initialized to
val
-
error_get_last()
- Get the last occurred error as associative array. Returns
NULL
if there hasn't been an error yet - image_type_to_extension() - Get file extension for image-type returned by getimagesize(), exif_read_data(), exif_thumbnail(), exif_imagetype()
- memory_get_peak_usage() - Returns the peak allocated by PHP memory
- sys_get_temp_dir() - Returns directory path used for temporary files. (Added in 5.2.1)
- timezone_abbreviations_list() - Returns associative array containing DST, offset and the timezone name
- timezone_identifiers_list() - Returns numerically indexed array with all timezone identifiers
- timezone_name_from_abbr() - Returns the timezone name from abbreviation
- stream_socket_shutdown() - Causes all or part of a full-duplex connection on the socket associated with stream to be shut down. As of PHP 5.2.1.
- imagegrabscreen() - Grabs a screenshot of the whole screen. As of PHP 5.2.2.
- imagegrabwindow() - Captures a window. As of PHP 5.2.2.
- libxml_disable_entity_loader() - Disable the ability to load external entities. As of PHP 5.2.11.
- mb_stripos() - Finds position of first occurrence of a string within another, case insensitive
- mb_stristr() - Finds first occurrence of a string within another, case insensitive
- mb_strrchr() - Finds the last occurrence of a character in a string within another
- mb_strrichr() - Finds the last occurrence of a character in a string within another, case insensitive
- mb_strripos() - Finds position of last occurrence of a string within another, case insensitive
- mb_strstr() - Finds first occurrence of a string within another
ming (As of PHP 5.2.1):
- void ming_setSWFCompression(int num) - Sets output compression
- void swfmovie::namedanchor(string name) - Creates anchor
- void swfmovie::protect([string password]) - Protects
- openssl_csr_get_public_key() - Extracts public key from a CERT and prepares it for use
- openssl_csr_get_subject() - Returns the subject of a CERT
- openssl_pkey_get_details() - Returns an array with the key details (bits, pkey, type)
spl:
- spl_object_hash() - Return hash id for given object
- int iterator_apply(Traversable it, mixed function [, mixed params]) - Calls a function for every element in an iterator
pcre:
- preg_last_error() - Returns the error code of the last regex execution
-
pg_field_table()
- Returns the name of the table field belongs to, or table's oid
if
oid_only
isTRUE
- posix_initgroups() - Calculate the group access list for the user specified in name
gmp:
- gmp_nextprime() - Finds next prime number
-
xmlwriter_full_end_element()
- End current element - returns
FALSE
on error -
xmlwriter_write_raw()
- Write text - returns
FALSE
on error -
xmlwriter_start_dtd_entity()
- Create start DTD Entity - returns
FALSE
on error -
xmlwriter_end_dtd_entity()
- End current DTD Entity - returns
FALSE
on error -
xmlwriter_write_dtd_entity()
- Write full DTD Entity tag - returns
FALSE
on error
PHP 5.0
New Functions
In PHP 5 there are some new functions. Here is the list of them:
- array_combine() - Creates an array by using one array for keys and another for its values
- array_diff_uassoc() - Computes the difference of arrays with additional index check which is performed by a user supplied callback function
- array_udiff() - Computes the difference of arrays by using a callback function for data comparison
- array_udiff_assoc() - Computes the difference of arrays with additional index check. The data is compared by using a callback function
- array_udiff_uassoc() - Computes the difference of arrays with additional index check. The data is compared by using a callback function. The index check is done by a callback function also
- array_walk_recursive() - Apply a user function recursively to every member of an array
- array_uintersect_assoc() - Computes the intersection of arrays with additional index check. The data is compared by using a callback function
- array_uintersect_uassoc() - Computes the intersection of arrays with additional index check. Both the data and the indexes are compared by using separate callback functions
- array_uintersect() - Computes the intersection of arrays. The data is compared by using a callback function
- ibase_affected_rows() - Return the number of rows that were affected by the previous query
- ibase_backup() - Initiates a backup task in the service manager and returns immediately
- ibase_commit_ret() - Commit a transaction without closing it
- ibase_db_info() - Request statistics about a database
- ibase_drop_db() - Drops a database
- ibase_errcode() - Return an error code
- ibase_free_event_handler() - Cancels a registered event handler
- ibase_gen_id() - Increments the named generator and returns its new value
- ibase_maintain_db() - Execute a maintenance command on the database server
- ibase_name_result() - Assigns a name to a result set
- ibase_num_params() - Return the number of parameters in a prepared query
- ibase_param_info() - Return information about a parameter in a prepared query
- ibase_restore() - Initiates a restore task in the service manager and returns immediately
- ibase_rollback_ret() - Rollback transaction and retain the transaction context
- ibase_server_info() - Request statistics about a database server
- ibase_service_attach() - Connect to the service manager
- ibase_service_detach() - Disconnect from the service manager
- ibase_set_event_handler() - Register a callback function to be called when events are posted
- ibase_wait_event() - Wait for an event to be posted by the database
- iconv_mime_decode() - Decodes a MIME header field
- iconv_mime_decode_headers() - Decodes multiple MIME header fields at once
- iconv_mime_encode() - Composes a MIME header field
- iconv_strlen() - Returns the character count of string
- iconv_strpos() - Finds position of first occurrence of a needle within a haystack
- iconv_strrpos() - Finds the last occurrence of a needle within a haystack
- iconv_substr() - Cut out part of a string
- stream_copy_to_stream() - Copies data from one stream to another
- stream_get_line() - Gets line from stream resource up to a given delimiter
- stream_socket_accept() - Accept a connection on a socket created by stream_socket_server()
- stream_socket_client() - Open Internet or Unix domain socket connection
- stream_socket_get_name() - Retrieve the name of the local or remote sockets
- stream_socket_recvfrom() - Receives data from a socket, connected or not
- stream_socket_sendto() - Sends a message to a socket, whether it is connected or not
- stream_socket_server() - Create an Internet or Unix domain server socket
- idate() - Format a local time/date as integer
- date_sunset() - Time of sunset for a given day and location
- date_sunrise() - Time of sunrise for a given day and location
- time_nanosleep() - Delay for a number of seconds and nanoseconds
- str_split() - Convert a string to an array
- strpbrk() - Search a string for any of a set of characters
- substr_compare() - Binary safe optionally case insensitive comparison of two strings from an offset, up to length characters
Other:
- convert_uudecode() - decode a uuencoded string
- convert_uuencode() - uuencode a string
- curl_copy_handle() - Copy a cURL handle along with all of its preferences
- dba_key_split() - Splits a key in string representation into array representation
- dbase_get_header_info() - Get the header info of a dBase database
-
dbx_fetch_row() - Fetches rows from a query-result
that had the
DBX_RESULT_UNBUFFERED
flag set - fbsql_set_password() - Change the password for a given user
- file_put_contents() - Write a string to a file
- ftp_alloc() - Allocates space for a file to be uploaded
- get_declared_interfaces() - Returns an array of all declared interfaces
- get_headers() - Fetches all the headers sent by the server in response to a HTTP request
- headers_list() - Returns a list of response headers sent (or ready to send)
- http_build_query() - Generate URL-encoded query string
- image_type_to_extension() - Get file extension for image-type returned by getimagesize(), exif_read_data(), exif_thumbnail(), exif_imagetype()
- imagefilter() - Applies a filter to an image using custom arguments
- imap_getacl() - Gets the ACL for a given mailbox
- ldap_sasl_bind() - Bind to LDAP directory using SASL
- mb_list_encodings() - Returns an array of all supported encodings
- pcntl_getpriority() - Get the priority of any process
-
pcntl_wait() - Waits on or returns the status of a
forked child as defined by the
waitpid()
system call - pg_version() - Returns an array with client, protocol and server version (when available)
- php_check_syntax() - Check the syntax of the specified file
- php_strip_whitespace() - Return source with stripped comments and whitespace
- proc_nice() - Change the priority of the current process
- pspell_config_data_dir() - Change location of language data files
- pspell_config_dict_dir() - Change location of the main word list
- setrawcookie() - Send a cookie without URL-encoding the value
- scandir() - List files and directories inside the specified path
- snmp_read_mib() - Reads and parses a MIB file into the active MIB tree
- sqlite_fetch_column_types() - Return an array of column types from a particular table
Note:
The Tidy extension has also changed its API completely.