Dodatki
PHP Manual

Changelog

The following changes have been made to functions of bundled extensions.

VersionFunctionDescription
PHP 4.3.3ftruncatePrzed tym wydaniem ftruncate zwracała integer o wartości 1 w przypadku sukcesu, zamiast boolean TRUE.
before 4.3.5dba_openopen 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.5.0emptyempty now supports expressions, rather than only variables.
 php_logo_guidphp_logo_guid has been removed from PHP.
 preg_replaceThe /e modifier is deprecated. Use preg_replace_callback instead.
 zend_logo_guidzend_logo_guid has been removed from PHP.
 mysqli::optionsThe MYSQLI_SERVER_PUBLIC_KEY option was added.
5.4.8assertThe description parameter was added. The description is also now provided to a callback function in ASSERT_CALLBACK mode as the fourth argument.
5.4.1hex2binA warning is thrown if the input string is of odd length. In PHP 5.4.0 the string was silently accepted, but the last byte was truncated.
5.4.0apache_request_headersThis function became available under FastCGI. Previously, it was supported only when PHP was installed as an Apache module.
 apache_response_headersTa funkcja stała się również dostępna w FastCGI. Poprzednio była ona obsługiwana tylko przez PHP zainstalowany jako moduł serwera Apache.
 debug_backtraceAdded the optional parameter limit.
 debug_print_backtraceAdded the optional parameter limit.
 emptyChecking non-numeric offsets of strings returns TRUE.
 error_reportingE_STRICT became part of E_ALL.
 get_html_translation_tableThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 get_html_translation_tableThe default value for the encoding parameter was changed to UTF-8.
 get_magic_quotes_gpcAlways returns FALSE because the magic quotes feature was removed from PHP.
 get_magic_quotes_runtimeAlways returns FALSE because the magic quotes feature was removed from PHP.
 gzencodeFORCE_DEFLATE now generates RFC 1950 compliant output.
 html_entity_decodeDefault encoding changed from ISO-8859-1 to UTF-8.
 html_entity_decodeThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 htmlentitiesThe default value for the encoding parameter was changed to UTF-8.
 htmlentitiesThe constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 htmlspecialcharsThe constants ENT_SUBSTITUTE, ENT_DISALLOWED, ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 htmlspecialcharsThe default value for the encoding parameter was changed to UTF-8.
 htmlspecialchars_decodeThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 imagecolorsetThe alpha parameter was added.
 issetChecking non-numeric offsets of strings now returns FALSE.
 ob_startA chunk size of 1 now results in chunks of 1 byte being sent to the output buffer.
 preg_match_allThe matches parameter became optional.
 snmp_set_valueretrievalConstants 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::SoapClientNew keep_alive option.
5.3.7cryptAdded $2x$ and $2y$ Blowfish modes to deal with potential high-bit attacks.
5.3.6DOMDocument::saveHTMLThe node parameter was added.
 debug_backtraceThe parameter provide_object changed to options and additional option DEBUG_BACKTRACE_IGNORE_ARGS is added.
 debug_print_backtraceAdded the optional parameter options.
 preg_matchReturns FALSE if offset is higher than subject length.
 preg_match_allReturns FALSE if offset is higher than subject length.
 PDO_MYSQL DSNPrior to version 5.3.6, charset was ignored.
5.3.4get_html_translation_tableThe encoding parameter was added.
 sleepBefore PHP 5.3.4, on Windows, sleep always returns NULL when sleep has occurred, regardless of whether the sleep was interrupted or not.
5.3.3DOMXPath::evaluateThe registerNodeNS parameter was added.
 DOMXPath::queryThe registerNodeNS parameter was added.
 ldap_sasl_bindSupport on Windows was added.
 openssl_decryptThe iv parameter was added.
 openssl_encryptThe iv parameter was added.
5.3.2 (PECL OCI8 1.4)oci_set_prefetchBefore this release, rows must be >= 1.
5.3.2cryptAdded SHA-256 and SHA-512 crypt based on Ulrich Drepper's implementation.
 cryptFixed Blowfish behaviour on invalid rounds to return "failure" string ("*0" or "*1"), instead of falling back to DES.
 flockThe automatic unlocking when the file's resource handle is closed was removed. Unlocking now always has to be done manually.
 gmp_initThe base was extended from 2 to 36, to 2 to 62 and -2 to -36.
 gmp_strvalThe base was extended from 2 to 36, to 2 to 62 and -2 to -36.
 imap_appendAdded INTERNALDATE support to imap_append.
 imap_openparams added
5.3.1get_defined_constantsWindows only: Core constants are categorized under Core, previously mhash.
 renamerename can now rename files across drives in Windows.
5.3.0 (PECL OCI8 1.3.4)oci_set_prefetchBefore this release, prefetching was limited to the lesser of rows rows and 1024 * rows bytes. The byte size restriction has now been removed.
5.3.0DirectoryIterator::__constructThrows UnexpectedValueException if the path cannot be opened.
 call_user_funcThe 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_arrayThe 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.
 checkdnsrrThis function is now available on Windows platforms.
 clearstatcacheDodano opcjonalne parametry clear_realpath_cache i filename.
 copyDodano obsługę kontekstu.
 cryptPHP now contains its own implementation for the MD5 crypt, Standard DES, Extended DES and the Blowfish algorithms and will use that if the system lacks of support for one or more of the algorithms.
 define_syslog_variablesThis function now throws an E_DEPRECATED notice.
 dldl is now disabled in some SAPIs due to stability issues. The only SAPIs that allow dl are CLI and Embed. Use the Extension Loading Directives instead.
 dns_get_recordThis function is now available on Windows platforms.
 dns_get_recordPrior to this release, if the authns parameter was given, the addtl parameter was also required.
 error_reportingE_DEPRECATED and E_USER_DEPRECATED introduced.
 fgetcsvDodano parametr ucieczka
 fnmatchThis function is now available on Windows platforms.
 func_get_argIf 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_argThis function can now be used in parameter lists.
 func_get_argsIf 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_argsThis function can now be used in parameter lists.
 func_num_argsIf 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_argsThis function can now be used in parameter lists.
 gd_infoJPG Support attribute renamed to JPEG Support.
 get_cfg_varget_cfg_var was fixed to be able to return "array" ini options.
 get_defined_constantsCore constants are categorized under Core, previously internal. On Windows, the Core Constants are categorized under mhash.
 getimagesizeAdded icon support.
 getmxrrThis function is now available on Windows platforms.
 getoptAdded support for "=" as argument/value separator.
 getoptAdded support for optional values (specified with "::").
 getoptThis function is no longer system dependent, and now works on Windows, too.
 getoptParameter longopts is available on all systems.
 htmlentitiesThe constant ENT_IGNORE was added.
 htmlspecialcharsThe constant ENT_IGNORE was added.
 imagecolorclosesthwbThis function is now available on Windows
 imagefilterPixelation support (IMG_FILTER_PIXELATE) was added.
 inet_ntopThis function is now available on Windows platforms.
 inet_ptonThis function is now available on Windows platforms.
 ini_get_allAdded details.
 mb_get_infoThe entry "http_output_conv_mimetypes" was made available.
 mcrypt_create_ivMCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM became available on Windows platforms.
 mcrypt_create_ivIt is no longer required to call srand first. This is now done automatically.
 nl2brAdded the optional is_xhtml parameter.
 parse_ini_fileAdded 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.
 preg_quoteThe - character is now quoted
 realpathPrior to this release, if only the last path component did not exist, realpath would not fail on *BSD systems. realpath now fails in this case.
 register_tick_functionTicks are now supported on threaded web server modules.
 setlocaleThis function now throws an E_DEPRECATED notice if a string is passed to the category parameter instead of one of the LC_* constants.
 shm_attachThis function now returns a zasób instead of an integer.
 socket_create_pairThis function is now re-enabled on Windows platforms.
 spl_autoload_registerNamespaces support was introduced.
 spl_autoload_registerThe prepend parameter was added.
 stream_context_createAdded the optional params argument.
 stream_socket_pairThis function is now available on Windows platforms.
 stristrAdded the optional parameter before_needle.
 strlenPrior versions treated arrays as the string Array, thus returning a string length of 5 and emitting an E_NOTICE level error.
 strstrAdded the optional parameter before_needle.
 sybase_connectThe new parameter was added.
 time_nanosleepThis function is now available on Windows platforms.
 time_sleep_untilThis function is now available on Windows platforms.
 touchMożliwa jest zmiana czasu modyfikacji katalogu pod Windows.
 mysqli::__constructAdded the ability of persistent connections.
 mysqli::queryAdded the ability of async queries.
 ReflectionFunction::__constructname can now be a closure.
 SplObjectStorage::attachAdded the data parameter.
5.2.15 & 5.3.4mysqli_reportChanging the reporting mode is now be per-request, rather than per-process.
5.2.11get_defined_constantsThe categorize parameter now operates appropriately. Previously, the categorize parameter was interpreted as !is_null($categorize), making any value other than NULL force the constants to be categorized.
5.2.10curl_setoptIntroduced CURLOPT_PROTOCOLS, and CURLOPT_REDIR_PROTOCOLS.
 ip2longPrior 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.8XSLTProcessor::importStylesheetAccepts SimpleXMLElement again which was broken since PHP 5.2.6.
5.2.7error_logThe possible value of 4 was added to message_type.
 parse_ini_fileOn syntax error this function will return FALSE rather than an empty array.
5.2.5addcslashesThe escape sequences \v and \f were added.
 debug_backtraceAdded the optional parameter provide_object.
 imagefilterAlpha support for IMG_FILTER_COLORIZE was added.
5.2.4checkdnsrrTXT type was added.
 get_loaded_extensionsThe optional zend_extensions parameter was added
 ldap_first_attributeThe ber_identifier was removed. This is now handled automatically by PHP.
 ldap_next_attributeThe ber_identifier was removed. This is now handled automatically by PHP.
 parse_ini_fileKeys 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.
 stream_wrapper_registerAdded the flags parameter.
5.2.3getimagesizeRead errors generated by this function downgraded to E_NOTICE from E_WARNING.
 htmlentitiesThe double_encode parameter was added.
 htmlspecialcharsThe double_encode parameter was added.
 XMLWriter::writeElementThe content parameter became optional.
 XMLWriter::writeElementNSThe content parameter became optional.
 PDOStatement::getColumnMetatable field
5.2.2 - 5.2.6substrIf the start parameter indicates the position of a negative truncation or beyond, false is returned. Other versions get the string from start.
5.2.2DOMDocument::registerNodeClassPrior 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_connectThe function was changed to return FALSE when it can't use an SSL connection, instead of fallbacking to a non-SSL one as previously.
 phpinfoThe "Loaded Configuration File" information was added, when before only "Configuration File (php.ini) Path" existed.
 preg_matchNamed subpatterns now accept the syntax (?<name>) and (?'name') as well as (?P<name>). Previous versions accepted only (?P<name>).
 preg_match_allNamed subpatterns now accept the syntax (?<name>) and (?'name') as well as (?P<name>). Previous versions accepted only (?P<name>).
 proc_terminatePrevious versions used to destroy the given process resource.
5.2.1iterator_to_arrayThe use_keys parameter was added.
 memory_get_peak_usageCompiling with --enable-memory-limit is no longer required for this function to exist.
 memory_get_usageCompiling with --enable-memory-limit is no longer required for this function to exist.
 proc_openAdded the bypass_shell option to the other_options parameter.
5.2.0curl_multi_info_readmsgs_in_queue was added.
 error_reportingE_RECOVERABLE_ERROR introduced.
 imagettftextIt is now possible to specify an hexadecimal entity in text.
 imap_openn_retries added
 imap_reopenn_retries added
 mb_strrposAdded the optional parameter offset.
 memory_get_peak_usagereal_usage was added.
 memory_get_usagereal_usage was added.
 openssl_verifyThe signature_alg parameter was added.
 pathinfoZostała dodana stała PATHINFO_FILENAME.
 set_error_handlerThe error handler must return FALSE to populate $php_errormsg.
 setcookieThe httponly parameter was added.
 setrawcookieThe httponly parameter was added.
 snmp_set_oid_numeric_printSince PHP 5.2.0.
 PDOStatement::executeThe keys from input_parameters must match the ones declared in the SQL. Before PHP 5.2.0 this was silently ignored.
 SimpleXMLElement::childrenThe optional parameter is_prefix was added.
 SimpleXMLElement::__constructAdded the ns and is_prefix parameters.
 SoapServer::SoapServerAdded the typemap option.
 SWFMovie::streamMP3skip added
 XMLReader::openencoding and options were added.
 XMLReader::XMLencoding and options were added.
5.1.3DirectoryIterator::__constructThrows RuntimeException if the path is an empty string.
 curl_getinfoIntroduced CURLINFO_HEADER_OUT.
 imagecolorallocateReturns FALSE if the allocation failed. Previously -1 was returned.
 imagecolorallocatealphaReturns FALSE if the allocation failed. Previously -1 was returned.
 imagepngAdded the filters parameter.
 mb_get_infoThe entries "mail_charset", "mail_header_encoding", and "mail_body_encoding" were made available.
 SoapClient::__doRequestThe one_way parameter was added.
 XMLReader::getAttributeReturn NULL if no attribute found. Previously, returned an empty string.
5.1.2imagepngAdded the quality parameter.
 SimpleXMLElement::__constructAdded the options and data_is_url parameters.
5.1.1debug_backtraceAdded the current object as a possible return element.
5.1.0DirectoryIterator::__constructThrows RuntimeException on error. Previously, threw Exception.
 DOMDocument::saveAdded the options parameter
 DOMDocument::saveXMLAdded the options parameter
 class_implementsAdded the option to pass the class parameter as a string. Added the autoload parameter.
 class_parentsAdded the option to pass the class parameter as a string. Added the autoload parameter.
 ctype_digitBefore PHP 5.1.0, this function returned TRUE when text was an empty string.
 curl_setoptIntroduced CURLOPT_AUTOREFERER, CURLOPT_BINARYTRANSFER, CURLOPT_FTPSSLAUTH, CURLOPT_PROXYAUTH, and CURLOPT_TIMECONDITION.
 explodeSupport for negative limits was added
 file_get_contentsAdded the offset and maxlen parameters.
 file_put_contentsAdded support for LOCK_EX and the ability to pass a stream resource to the data parameter
 globGLOB_ERR was added
 imagerotateignore_transparent was added.
 intvalThrows E_NOTICE and returns 1, when an object is passed to var.
 md5_fileChanged the function to use the streams API. It means that you can use it with wrappers, like md5_file('http://example.com/..')
 openssl_pkcs7_verifyThe content parameter was added.
 preg_replaceAdded the count parameter
 preg_replace_callbackThe count parameter was added
 session_regenerate_idDodano parametr usunięcie_starej_sesji.
 sha1_fileChanged the function to use the streams API. It means that you can use it with wrappers, like sha1_file('http://example.com/..')
 sqlite_execAdded the error_msg parameter
 sqlite_fetch_column_typesAdded result_type
 sqlite_queryAdded the error_msg parameter
 sqlite_unbuffered_queryAdded the error_msg parameter
 str_word_countAdded the charlist parameter
 stream_copy_to_streamAdded the offset parameter
 stream_filter_appendPrior to PHP 5.1.0, this function returns TRUE on success lub FALSE w przypadku niepowodzenia.
 stream_filter_prependPrior to PHP 5.1.0, this function returns TRUE on success lub FALSE w przypadku niepowodzenia.
 stream_get_contentsThe offset was added.
 substr_compareAdded the possibility to use a negative offset.
 substr_countAdded the offset and the length parameters
 var_exportPossibility to export classes and arrays containing classes using the __set_state() magic method.
 XSLTProcessor::registerPHPFunctionsThe restrict parameter was added.
5.0.5php_check_syntaxThis function was removed from PHP.
5.0.3php_check_syntaxCalling exit after php_check_syntax resulted in a Segfault.
5.0.1php_check_syntaxerror_message is passed by reference.
5.0.0apache_get_modulesBecame 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_versionBecame available with the Apache 2 filter API.
 cal_infoThe calendar parameter becomes optional and defaults to "all calendars" if omitted.
 checkdnsrrAAAA type was added.
 com_releaseThis function was removed.
 curl_setoptIntroduced CURLOPT_FTP_USE_EPRT, CURLOPT_NOSIGNAL, CURLOPT_UNRESTRICTED_AUTH, CURLOPT_BUFFERSIZE, CURLOPT_HTTPAUTH, CURLOPT_PROXYPORT, CURLOPT_PROXYTYPE, CURLOPT_SSLCERTTYPE, and CURLOPT_HTTP200ALIASES.
 dirnamedirname od teraz jest binarnie bezpieczna
 emptyObjects with no properties are no longer considered empty.
 error_reportingE_STRICT introduced (not part of E_ALL).
 extension_loadedextension_loaded uses the internal extension name to test whether a certain extension is available or not. Most internal extension names are written in lower case but there may be extensions available which also use uppercase letters. Prior to PHP 5, this function compared the names case sensitively.
 fgetssParametr długość jest opcjonalny.
 file_get_contentsAdded context support.
 file_put_contentsAdded context support
 get_defined_constantsThe categorize parameter was added.
 get_defined_varsThe $GLOBALS variable is included in the results of the array returned.
 html_entity_decodeSupport for multi-byte encodings was added.
 ip2longPrior to this version, ip2long returned -1 on failure.
 jdtojewishThe fl parameter was added.
 mb_encode_mimeheaderThe indent parameter was added.
 mb_send_mailThe 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.
 md5The raw_output parameter was added.
 md5_fileAdded the raw_output parameter
 openssl_pkcs7_encryptThe cipherid parameter was added.
 openssl_signThe signature_alg parameter was added.
 parse_ini_fileValues enclosed in double quotes can contain new lines.
 proc_openAdded the cwd, env and other_options parameters.
 realpathPrior to this release, a blank or NULL path would cause realpath to return the directory name of the script.
 renamerename can now also be used with some URL wrappers. Refer to for a listing of which wrappers support rename.
 set_error_handlerThe error_types parameter was introduced.
 sha1The raw_output parameter was added.
 sha1_fileAdded the raw_output parameter
 socket_createThe AF_INET6 constant was added.
 str_ireplaceThe count parameter was added.
 str_replaceThe count parameter was added.
 stream_get_meta_dataThe following entries were added in the returned array: mode, seekable, and uri.
 strip_tagsstrip_tags is now binary safe.
 uniqidThe prefix parameter was made optional.
 unlinkOd PHP 5.0.0 unlink może być również użyty z niektórymi osłonami (wrapperami) URL. Zajrzyj do aby uzyskać listę wrapperów, które obsługuje unlink.
 usleepThis function now works on Windows systems.
 mysqli_result::fetch_objectAdded the ability to return as a different object.

Dodatki
PHP Manual