The following changes have been made to functions of bundled extensions.
Version | Function | Description |
---|---|---|
Since 5.3.0 | get_class | NULL became the default value for object, so passing NULL to object now has the same result as not passing any value. |
Since 5.2.1 | mt_srand | The Mersenne Twister implementation in PHP now uses a new seeding algorithm by Richard Wagner. Identical seeds no longer produce the same sequence of values they did in previous versions. This behavior is not expected to change again, but it is considered unsafe to rely upon it nonetheless. |
Since 5.0.0 | get_class | The class name is returned in its original notation. |
get_class | The object parameter is optional if called from the object's method. | |
get_parent_class | The object parameter is optional if called from the object's method. | |
Since 4.2.0 | mt_srand | The seed becomes optional and defaults to a random value if omitted. |
srand | The seed becomes optional and defaults to a random value if omitted. | |
Since 4.1.0 | bindec | The function can now convert numbers that are too large to fit into the platforms integer type, larger values are returned as float in that case. |
octdec | The function can now convert numbers that are too large to fit into the platforms integer type, larger values are returned as float in that case. | |
Since 4.0.5 | get_parent_class | If object is a string, returns the name of the parent class of the class with that name. |
prior to 5.3.0 | get_object_vars | If the object isn't an object, then get_object_vars would return FALSE |
Prior to 5.1.3 | imagecolorallocatealpha | Returns -1 if the allocation failed. |
Prior to 4.2.0 | get_class_vars | Uninitialized class variables will not be reported by get_class_vars |
prior to 4.2.0 | get_object_vars | If the variables declared in the class of which the object is an instance, have not been assigned a value, those will not be returned in the array |
PHP 5.3.2 (PECL OCI8 1.4) | oci_set_prefetch | Before this release, rows must be >= 1. |
PHP 5.3 (PECL OCI8 1.3.4) | oci_set_prefetch | Before this release, prefetching was limited to the lesser of rows rows and 1024 * rows bytes. The byte size restriction has now been removed. |
PHP 4.3.3 | ftruncate | Prior to this release ftruncate returned an integer value of 1 on success, instead of boolean TRUE. |
Before 5.1.0 | get_parent_class | If called without parameter outside object, this function would have returned NULL with a warning. |
before 4.3.5 | dba_open | open mode "c" is broken for several internal handlers and truncates the database instead of appending data to an existent database. Also dbm and ndbm fail on mode "c" in typical configurations (this cannot be fixed). |
5.4.0 | apache_child_terminate | 该函数目前也可以用于FastCGI模式了。以前,它仅在PHP作为Apapche的模块安装时支持。 |
apache_request_headers | This function became available under FastCGI. Previously, it was supported only when PHP was installed as an Apache module. | |
apache_response_headers | This function became available under FastCGI. Previously, it was supported only when PHP was installed as an Apache module. | |
date_default_timezone_get | The TZ environment variable is no longer used to guess the timezone. | |
date_default_timezone_get | The timezone is no longer guessed from information available through the operating system as the guessed timezone can not be relied on. | |
empty | Checking non-numeric offsets of strings returns TRUE. | |
getallheaders | This function became available under FastCGI. Previously, it was supported only when PHP was installed as an Apache module. | |
isset | Checking non-numeric offsets of strings now returns FALSE. | |
json_decode | The options parameter was added. | |
json_encode | options 参数增加常量: JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, 和 JSON_UNESCAPED_UNICODE。 | |
scandir | sorting_order now accepts constants. Any nonzero value caused descending order in previous versions. | |
session_set_save_handler | Added SessionHandlerInterface for implementing session handlers and SessionHandler to expose internal PHP session handlers. | |
snmp_set_valueretrieval | Constants SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY may be combined with SNMP_VALUE_OBJECT resulting different way of representing contents of value array element in return value of GET-function. If no SNMP_VALUE_{PLAIN,LIBRARY} constant is accompanying SNMP_VALUE_OBJECT, SNMP_VALUE_LIBRARY is used. Prior to 5.4.0 SNMP_VALUE_OBJECT effecively meant SNMP_VALUE_OBJECT|SNMP_VALUE_PLAIN. | |
SoapClient::SoapClient | New keep_alive option. | |
5.3.9 | is_subclass_of | Added allow_string parameter |
5.3.6 | DateTime::modify | Absolute date/time statements now take effect. Previously, only relative parts were used. |
DOMDocument::saveHTML | The node parameter was added. | |
PDO_MYSQL DSN | Prior to version 5.3.6, charset was ignored. | |
5.3.4 | rawurlencode | Tilde characters are no longer encoded when rawurlencode is used with EBCDIC strings. |
5.3.3 | DOMXPath::evaluate | The registerNodeNS parameter was added. |
DOMXPath::query | The registerNodeNS parameter was added. | |
json_encode | options 参数增加常量:JSON_NUMERIC_CHECK。 | |
ldap_sasl_bind | Support on Windows was added. | |
openssl_decrypt | The iv parameter was added. | |
openssl_encrypt | The iv parameter was added. | |
parse_url | Removed the E_WARNING that was emitted when URL parsing failed. | |
5.3.2 | flock | The automatic unlocking when the file's resource handle is closed was removed. Unlocking now always has to be done manually. |
gmp_init | The base was extended from 2 to 36, to 2 to 62 and -2 to -36. | |
gmp_strval | The base was extended from 2 to 36, to 2 to 62 and -2 to -36. | |
imap_append | Added INTERNALDATE support to imap_append. | |
imap_open | params added | |
5.3.1 | ibase_query | On success the function now returns TRUE if there were no affected rows, where it previously returned 0 (a zero followed by an empty space). |
rename | rename can now rename files across drives in Windows. | |
5.3.0 | DateTime::__construct | If an invalid date is specified, then an exception is now thrown. Previously an error was emitted. |
DateTime::modify | 将返回值从NULL改为 DateTime 类型。 | |
DateTime::setDate | 将返回值从NULL改为 DateTime 类型。 | |
DateTime::setISODate | 将返回值从NULL改为 DateTime 类型。 | |
DateTime::setTime | 将返回值从NULL改为 DateTime 类型。 | |
DateTime::setTimezone | 将返回值从NULL改为 DateTime 类型。 | |
DateTimeZone::getTransitions | The optional timestamp_begin and timestamp_end were added. | |
DateTimeZone::listIdentifiers | Added the optional what and country parameters. | |
acosh | This function is now available on all platforms | |
asinh | This function is now available on all platforms | |
atanh | This function is now available on all platforms | |
call_user_func | The interpretation of object oriented keywords like parent and self has changed. Previously, calling them using the double colon syntax would emit an E_STRICT warning because they were interpreted as static. | |
call_user_func_array | The interpretation of object oriented keywords like parent and self has changed. Previously, calling them using the double colon syntax would emit an E_STRICT warning because they were interpreted as static. | |
checkdnsrr | This function is now available on Windows platforms. | |
clearstatcache | 增加了可选的 clear_realpath_cache 和 filename 参数. | |
copy | Added context support. | |
define_syslog_variables | This function now throws an E_DEPRECATED notice. | |
dns_get_record | This function is now available on Windows platforms. | |
dns_get_record | Prior to this release, if the authns parameter was given, the addtl parameter was also required. | |
expm1 | This function is now available on all platforms | |
fgetcsv | The escape parameter was added | |
func_get_arg | If this function is called from the outermost scope of a file which has been included by calling include or require from within a function in the calling file, it now generates a warning and returns FALSE. | |
func_get_arg | This function can now be used in parameter lists. | |
func_get_args | This function can now be used in parameter lists. | |
func_get_args | If this function is called from the outermost scope of a file which has been included by calling include or require from within a function in the calling file, it now generates a warning and returns FALSE. | |
func_num_args | If this function is called from the outermost scope of a file which has been included by calling include or require from within a function in the calling file, it now generates a warning and returns -1. | |
func_num_args | This function can now be used in parameter lists. | |
get_object_vars | This function now returns NULL if the object isn't an object. | |
getimagesize | Added icon support. | |
getmxrr | This function is now available on Windows platforms. | |
imagefilter | Pixelation support (IMG_FILTER_PIXELATE) was added. | |
inet_ntop | This function is now available on Windows platforms. | |
inet_pton | This function is now available on Windows platforms. | |
json_decode | Added the optional depth. The default recursion depth was increased from 128 to 512 | |
json_encode | 增加 options 参数. | |
link | This function is now available on Windows platforms (Vista, Server 2008 or greater). | |
linkinfo | This function is now available on Windows platforms (Vista, Server 2008 or greater). | |
log1p | This function is now available on all platforms | |
mb_get_info | The entry "http_output_conv_mimetypes" was made available. | |
mcrypt_create_iv | It is no longer required to call srand first. This is now done automatically. | |
mcrypt_create_iv | MCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM became available on Windows platforms. | |
mktime | mktime now throws E_DEPRECATED notice if the is_dst parameter is used. | |
parse_ini_file | Added optional scanner_mode parameter. Single quotes may now be used around variable assignments. Hash marks (#) may no longer be used as comments and will throw a deprecation warning if used. | |
pg_lo_import | The optional object_id was added. | |
property_exists | This function checks the existence of a property independent of accessibility. | |
rawurlencode | Now conforms to RFC 3986. | |
readlink | This function is now available on Windows platforms (Vista, Server 2008 or greater). | |
register_tick_function | Ticks are now supported on threaded web server modules. | |
session_start | If a session fails to start, then FALSE is returned. Previously TRUE was returned. | |
shm_attach | This function now returns a 资源(resource) instead of an integer. | |
socket_create_pair | This function is now re-enabled on Windows platforms. | |
stream_context_create | Added the optional params argument. | |
stream_socket_pair | This function is now available on Windows platforms. | |
strtotime | Prior to PHP 5.3.0, 24:00 was not a valid format and strtotime returned FALSE. | |
sybase_connect | The new parameter was added. | |
symlink | This function is now available on Windows platforms (Vista, Server 2008 or greater). | |
touch | It became possible to change the modification time of a directory under Windows. | |
ReflectionFunction::__construct | name can now be a closure. | |
5.2.10 | ip2long | Prior to this version, ip2long would sometimes return a valid number even if passed an value which was not an (IPv4) Internet Protocol dotted address. |
5.2.8 | XSLTProcessor::importStylesheet | Accepts SimpleXMLElement again which was broken since PHP 5.2.6. |
5.2.7 | parse_ini_file | On syntax error this function will return FALSE rather than an empty array. |
strtotime | In PHP 5 prior to 5.2.7, requesting a given occurrence of a given weekday in a month where that weekday was the first day of the month would incorrectly add one week to the returned timestamp. This has been corrected in 5.2.7 and later versions. | |
5.2.6 | fopen | The 'c' and 'c+' options were added |
5.2.5 | imagefilter | Alpha support for IMG_FILTER_COLORIZE was added. |
5.2.4 | checkdnsrr | TXT type was added. |
ldap_first_attribute | The ber_identifier was removed. This is now handled automatically by PHP. | |
ldap_next_attribute | The ber_identifier was removed. This is now handled automatically by PHP. | |
parse_ini_file | Keys and section names consisting of numbers are now evaluated as PHP integers thus numbers starting by 0 are evaluated as octals and numbers starting by 0x are evaluated as hexadecimals. | |
5.2.3 | getimagesize | Read errors generated by this function downgraded to E_NOTICE from E_WARNING. |
json_decode | The nesting limit was increased from 20 to 128 | |
XMLWriter::writeElement | The content parameter became optional. | |
XMLWriter::writeElementNS | The content parameter became optional. | |
PDOStatement::getColumnMeta | table field | |
5.2.2 | DOMDocument::registerNodeClass | Prior to 5.2.2, a previously registered extendedclass had to be unregistered before being able to register a new class extending the same baseclass. |
ftp_ssl_connect | The function was changed to return FALSE when it can't use an SSL connection, instead of fallbacking to a non-SSL one as previously. | |
proc_terminate | Previous versions used to destroy the given process resource. | |
token_get_all | Line numbers are returned in element 2 | |
5.2.1 | json_decode | Added support for JSON decoding of basic types. |
proc_open | Added the bypass_shell option to the other_options parameter. | |
5.2.0 | base64_decode | strict added |
imagettftext | It is now possible to specify an hexadecimal entity in text. | |
imap_open | n_retries added | |
imap_reopen | n_retries added | |
mb_strrpos | Added the optional parameter offset. | |
openssl_verify | The signature_alg parameter was added. | |
pathinfo | The PATHINFO_FILENAME constant was added. | |
session_get_cookie_params | The "httponly" entry was added in the returned array. | |
session_set_cookie_params | The httponly parameter was added. | |
setcookie | The httponly parameter was added. | |
setrawcookie | The httponly parameter was added. | |
snmp_set_oid_numeric_print | Since PHP 5.2.0. | |
PDOStatement::execute | The keys from input_parameters must match the ones declared in the SQL. Before PHP 5.2.0 this was silently ignored. | |
SimpleXMLElement::children | The optional parameter is_prefix was added. | |
SoapServer::SoapServer | Added the typemap option. | |
SWFMovie::streamMP3 | skip added | |
XMLReader::open | encoding and options were added. | |
XMLReader::XML | encoding and options were added. | |
5.1.3 | get_headers | This function now uses the default stream context, which can be set/changed with the stream_context_set_default function. |
mb_get_info | The entries "mail_charset", "mail_header_encoding", and "mail_body_encoding" were made available. | |
SoapClient::__doRequest | The one_way parameter was added. | |
XMLReader::getAttribute | Return NULL if no attribute found. Previously, returned an empty string. | |
5.1.2 | date_default_timezone_set | 本版本开始验证 timezone_identifier 参数。 |
parse_url | Added the component parameter. | |
5.1.1 | date | There are useful constants of standard date/time formats that can be used to specify the format parameter. |
5.1.0 | DOMDocument::save | Added the options parameter |
DOMDocument::saveXML | Added the options parameter | |
ctype_digit | Before PHP 5.1.0, this function returned TRUE when text was an empty string. | |
date | The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows). | |
date | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
date_sunrise | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
date_sunset | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
file_get_contents | Added the offset and maxlen parameters. | |
file_put_contents | 添加了对 LOCK_EX 的支持和 data 参数处理 stream 资源的功能。 | |
gettimeofday | The return_float parameter was added. | |
glob | GLOB_ERR was added | |
imagerotate | ignore_transparent was added. | |
localtime | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
mktime | is_dst 参数被废弃。出错时函数返回 FALSE 而不再是 -1。修正了本函数可以接受年月日参数全为零。 | |
mktime | The is_dst parameter became deprecated. Made the function return FALSE on error, instead of -1. Fixed the function to accept the year, month and day to be all passed as zero. | |
mktime | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
mktime | When called with no arguments, mktime throws E_STRICT notice. Use the time function instead. | |
openssl_pkcs7_verify | The content parameter was added. | |
session_regenerate_id | Added the delete_old_session parameter. | |
sqlite_exec | Added the error_msg parameter | |
sqlite_fetch_column_types | Added result_type | |
sqlite_query | Added the error_msg parameter | |
sqlite_unbuffered_query | Added the error_msg parameter | |
stream_copy_to_stream | Added the offset parameter | |
stream_filter_append | Prior to PHP 5.1.0, this function returns TRUE on success 或者在失败时返回 FALSE. | |
stream_filter_prepend | Prior to PHP 5.1.0, this function returns TRUE on success 或者在失败时返回 FALSE. | |
stream_get_contents | The offset was added. | |
strftime | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
strtotime | 现在发布 E_STRICT 和 E_NOTICE 时区错误。 | |
strtotime | 失败时返回 FALSE,不再是 -1。 | |
strtotime | Now returns FALSE on failure, instead of -1. | |
XSLTProcessor::registerPHPFunctions | The restrict parameter was added. | |
5.0.4 | sqlite_key | Prior to PHP 5.0.4, sqlite_key was only able to be called as a method on a SQLiteResult object, not procedurally. |
5.0.3 | get_class_vars | Depending on the scope, get_class_vars will only return the properties that can be accessed from the current scope. |
is_subclass_of | You may also specify the object parameter as a string (the name of the class) | |
5.0.2 | class_exists | No longer returns TRUE for defined interfaces. Use interface_exists. |
get_class_vars | Calling get_class_vars will now expose all the properties as an array, unlike previous behaviour where protected and private properties were prefixed with nul bytes. | |
strtotime | In PHP 5 up to 5.0.2, "now" and other relative times are wrongly computed from today's midnight. This differs from other versions where it is correctly computed from current time. | |
5.0.1 | get_class_vars | Calling get_class_vars will expose all properties, as when converting an object to a class. |
5.0.0 | apache_get_modules | Became available when using Apache 1, or the PHP Apache 2 filter API. Before this time, it was only available when using the Apache 2 handler API. |
apache_get_version | Became available with the Apache 2 filter API. | |
checkdnsrr | AAAA type was added. | |
class_exists | The autoload parameter was added. | |
empty | Objects with no properties are no longer considered empty. | |
fgetss | The length parameter is optional | |
file | The context parameter was added | |
file | Prior to PHP 5.0.0 the flags parameter only covered include_path and was enabled with 1 | |
file_get_contents | Added context support. | |
get_class_methods | As of PHP 5, this function returns the name of the methods as they were declared (case-sensitive). In PHP 4 they were lowercased. | |
ip2long | Prior to this version, ip2long returned -1 on failure. | |
is_executable | is_executable became available with Windows | |
mb_encode_mimeheader | The indent parameter was added. | |
mb_send_mail | The Content-Type and Content-Transfer-Encoding headers may be redefined as of PHP 5.0.0. Before this time, the values defined by mb_language are always used. | |
mkdir | The recursive parameter was added | |
mkdir | As of PHP 5.0.0 mkdir can also be used with some URL wrappers. Refer to for a listing of which wrappers support mkdir | |
mysql_fetch_object | Added the ability to return as a different object. | |
opendir | path 支持 ftp:// URL wrapper | |
openssl_pkcs7_encrypt | The cipherid parameter was added. | |
openssl_sign | The signature_alg parameter was added. | |
parse_ini_file | Values enclosed in double quotes can contain new lines. | |
proc_open | Added the cwd, env and other_options parameters. | |
rename | rename can now also be used with some URL wrappers. Refer to for a listing of which wrappers support rename. | |
rmdir | As of PHP 5.0.0 rmdir can also be used with some URL wrappers. Refer to for a listing of which wrappers support rmdir. | |
session_id | The , (comma) and - (minus) characters are allowed in the file session handler. | |
socket_create | The AF_INET6 constant was added. | |
strtotime | Microseconds began to be allowed, but they are ignored. | |
unlink | As of PHP 5.0.0 unlink can also be used with some URL wrappers. Refer to for a listing of which wrappers support unlink. |