Appendici
PHP Manual

Storico dei cambiamenti

Le seguenti modifiche sono state apportate alle funzioni delle estensioni del pacchetto.

VersionFunctionDescription
PHP 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.
7.0.0ob_startIn case ob_start is used inside an output buffer callback, this function will no longer issue an E_ERROR but instead an E_RECOVERABLE_ERROR, allowing custom error handlers to catch such errors.
6error_reportingE_STRICT è diventata parte di E_ALL.
5.6.3packThe "q", "Q", "J" and "P" codes were added to enable working with 64-bit numbers.
5.6.0hash_algosSupport for gost-crypto was added. This implements the GOST hash function using the CryptoPro S-box tables as specified by RFC 4357, section 11.2.
 json_decodeInvalid non-lowercased variants of the true, false and null literals are no longer accepted as valid input, and will generate warnings.
 mb_regex_encodingDefault encoding is changed to UTF-8. It was EUC-JP Previously.
 mcrypt_create_ivMCRYPT_DEV_URANDOM is now the default value of source.
 mcrypt_decryptInvalid key and iv sizes are no longer accepted. mcrypt_decrypt will now throw a warning and return FALSE if the inputs are invalid. Previously keys and IVs were padded with '\0' bytes to the next valid size.
 mcrypt_encryptInvalid key and iv sizes are no longer accepted. mcrypt_encrypt will now throw a warning and return FALSE if the inputs are invalid. Previously keys and IVs were padded with '\0' bytes to the next valid size.
 pg_lo_truncateAdded truncate function. It supports PostgreSQL 9.3's 64bit large object. Both client and server must support PostgreSQL 9.3 and PHP must be 64bit build to use 64bit large object.
 stream_socket_enable_cryptoThe crypto_type is now optional.
 ReflectionClass::newInstanceWithoutConstructorAll internal classes can now be instantiated except for those declared final.
 XMLReader::getAttributeNoXMLReader::getAttributeNo now returns NULL if the attribute doesn't exist.
 XMLReader::getAttributeNsXMLReader::getAttributeNS now returns NULL if the attribute doesn't exist.
5.5.19/5.6.3imagescaleThe calculation of the height if new_height was negative or omitted was fixed; prior to these versions, the aspect ratio was not maintained correctly.
5.5.8DatePeriod::__constructend type changed to DateTimeImmutable. Previously, DateTime.
5.5.2DOMDocument::schemaValidateAdded the flags parameter
 DOMDocument::schemaValidateSourceAdded the flags parameter
5.5.1hex2binA warning is thrown if the input string is invalid hexadecimal string.
5.5.0/PECL 3.0.0IntlDateFormatter::createAn IntlCalendar object is allowed for calendar. Objects of type IntlTimeZone and DateTimeZone are allowed for timezone. Invalid timezone identifiers (including empty strings) are no longer allowed for timezone. If NULL is given for timezone, the timezone identifier given by date_default_timezone_get will be used instead of ICUʼs default.
 IntlDateFormatter::formatSupport for providing IntlCalendar objects to the value parameter was added.
 IntlDateFormatter::setCalendarIt became possible to pass an IntlCalendar object.
5.5.0DatePeriod::__constructstart type changed to DateTimeImmutable. Previously, DateTime.
 emptyempty ora supporta le espressioni, piuttosto che solo variabili.
 gd_infoWebP Support added.
 imagerotateThis function is now affected by the interpolation method set by the imagesetinterpolation function.
 iterator_to_arrayiterator_to_array gained support for key types other than integer and string when the use_keys parameter is enabled.
 json_encodedepth parameter was added.
 packThe "Z" code was added with equivalent functionality to "a" for Perl compatibility.
 setcookieA Max-Age attribute is now included in the Set-Cookie header sent to the client.
 setrawcookieA Max-Age attribute is now included in the Set-Cookie header sent to the client.
 unpackChanges were made to bring this function into line with Perl: The "a" code now retains trailing NULL bytes. The "A" code now strips all trailing ASCII whitespace (spaces, tabs, newlines, carriage returns, and NULL bytes). The "Z" code was added for NULL-padded strings, and removes trailing NULL bytes.
 mysqli::commitAdded flags and name parameters.
 mysqli::optionsThe MYSQLI_SERVER_PUBLIC_KEY option was added.
 mysqli::rollbackAdded flags and name parameters.
 SoapClient::SoapClientNew ssl_method option.
5.4.7parse_urlFixed host recognition when scheme is omitted and a leading component separator is present.
5.4.4hex2binA 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.0/PECL 2.0.0b1idn_to_asciiAdded the parameters variant and idna_info; UTS #46 support.
 idn_to_utf8Added the parameters variant and idna_info; UTS #46 support.
5.4.0DOMDocument::loadHTMLAdded options parameter.
 DOMDocument::loadHTMLFileAdded options parameter.
 apache_child_terminateQuesta funzione diventa disponibile sotto FastCGI. Precedentemente, era supportata solo quando PHP era installato come modulo Apache.
 array_combineLe precedenti versioni generavano un E_WARNING e restituivano FALSE per gli array vuoti.
 date_default_timezone_getThe TZ environment variable is no longer used to guess the timezone.
 date_default_timezone_getThe timezone is no longer guessed from information available through the operating system as the guessed timezone can not be relied on.
 dns_get_recordAdded raw parameter.
 emptyIl controllo su offset non numerici di stringhe restituisce TRUE.
 filter_input_arrayAdded add_empty parameter.
 filter_var_arrayAdded add_empty parameter.
 gzcompressAggiunto il parametro encoding.
 hashThe tiger algorithm now uses big-endian byte ordering.
 hash_algosSupport for joaat, fnv132 and fnv164 was added. Support for Salsa10 and Salsa20 was removed.
 htmlspecialchars_decodeThe constants ENT_HTML401, ENT_XML1, ENT_XHTML and ENT_HTML5 were added.
 http_build_queryThe enc_type parameter was added.
 imagecolorsetThe alpha parameter was added.
 issetIl controllo su offset di stringhe non numerici ora restituisce FALSE.
 json_decodeThe options parameter was added.
 json_encodeJSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, and JSON_UNESCAPED_UNICODE options were added.
 mb_encode_numericentityAdded is_hex parameter.
 ob_startThe third parameter of ob_start changed from a boolean parameter called erase (which, if set to FALSE, would prevent the output buffer from being deleted until the script finished executing) to an integer parameter called flags. Unfortunately, this results in an API compatibility break for code written prior to PHP 5.4.0 that uses the third parameter. See the flags example for an example of how to handle this with code that needs to be compatible with both.
 ob_startA chunk size of 1 now results in chunks of 1 byte being sent to the output buffer.
 openssl_decryptThe raw_output was changed to options.
 openssl_encryptThe raw_output was changed to options.
 scandirsorting_order constants were added. Any nonzero value caused descending order in previous versions. So for all PHP versions, use 0 for ascending order, and 1 for descending order. An option for SCANDIR_SORT_NONE behavior did not exist prior to PHP 5.4.0.
 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.
 Phar::setStubAdded len parameter.
 PharData::setStubAdded len parameter.
 SimpleXMLElement::getDocNamespacesAdded from_root parameter.
 SoapClient::SoapClientNew keep_alive option.
5.4grapheme_substrIf length is given and positive and the argument string is shorter than the specified length, all the rest of the string according to start parameter is returned. Previously, FALSE was returned.
5.3.9is_aAggiunto il parametro allow_string
 is_subclass_ofAggiunto il parametro allow_string
5.3.7is_subclass_ofAggiunto il supporto per class_name per funzionare come le interfacce
5.3.6DateTime::modifyAbsolute date/time statements now take effect. Previously, only relative parts were used.
 DOMDocument::saveHTMLThe node parameter was added.
 array_productThe product of an empty array is now 1, when before this function would return 0 for an empty array.
 PDO_MYSQL DSNPrior to version 5.3.6, charset was ignored.
5.3.4rawurlencodeTilde characters are no longer encoded when rawurlencode is used with EBCDIC strings.
 sleepBefore PHP 5.3.4, on Windows, sleep always returns NULL when sleep has occurred, regardless of whether the sleep was interrupted or not.
 IntlDateFormatter::formatSupport for providing DateTime objects to the value parameter was added.
 mysqli_driver::$report_modeChanging the reporting mode is now be per-request, rather than per-process.
5.3.3DOMXPath::evaluateThe registerNodeNS parameter was added.
 DOMXPath::queryThe registerNodeNS parameter was added.
 json_encodeJSON_NUMERIC_CHECK option was added.
 ldap_sasl_bindSupport on Windows was added.
 openssl_decryptThe iv parameter was added.
 openssl_encryptThe iv parameter was added.
 parse_urlRemoved the E_WARNING that was emitted when URL parsing failed.
5.3.2 (PECL OCI8 1.4)oci_set_prefetchBefore this release, rows must be >= 1.
5.3.2imap_appendAdded INTERNALDATE support to imap_append.
 imap_openparams added
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.0DateTime::__constructIf time contains an invalid date/time format, then an exception is now thrown. Previously an error was emitted.
 DateTime::modifyModificato il valore di ritorno in caso di successo da NULL a DateTime.
 DateTime::setDateModificato il valore di ritorno in caso di successo da NULL a DateTime.
 DateTime::setISODateModificato il valore di ritorno in caso di successo da NULL a DateTime.
 DateTime::setTimeModificato il valore di ritorno in caso di successo da NULL a DateTime.
 DateTime::setTimezoneModificato il valore di ritorno in caso di successo da NULL a DateTime.
 DateTimeZone::getTransitionsThe optional timestamp_begin and timestamp_end were added.
 DateTimeZone::listIdentifiersAdded the optional what and country parameters.
 DirectoryIterator::__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.
 date_default_timezone_setNow throws E_WARNING rather than E_STRICT.
 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.
 exif_imagetypeAdded icon support.
 fnmatchThis function is now available on Windows platforms.
 func_get_argThis function can now be used in parameter lists.
 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_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_classNULL è diventato il valore di default per object, quindi passare NULL a object ora ha lo stesso risultato di non passare nessun valore.
 get_object_varsQuesta funzione ora restituisce NULL se object non è un oggetto. In precedenza veniva restituito FALSE.
 getimagesizeAdded icon support.
 hash_algosSupport for md2, ripemd256, ripemd320, salsa10, salsa20, snefru256 and sha224 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.
 is_aQuesta funzione non è più deprecata, e quindi non genererà warning E_STRICT.
 json_decodeAdded the optional depth. The default recursion depth was increased from 128 to 512
 json_encodeThe options parameter was added.
 mb_get_infoThe entry "http_output_conv_mimetypes" was made available.
 mcrypt_create_ivIt is no longer required to call srand first. This is now done automatically.
 mcrypt_create_ivMCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM became available on Windows platforms.
 property_existsThis function checks the existence of a property independent of accessibility.
 rawurlencodeNow conforms to RFC 3986.
 register_tick_functionTicks are now supported on threaded web server modules.
 setlocaleQuesta funzione emette un avviso E_DEPRECATED se una stringa è passata al parametro category invece che una delle costanti LC_*.
 spl_autoload_registerThe prepend parameter was added.
 spl_autoload_registerNamespaces support was introduced.
 stream_context_createAdded the optional params argument.
 stream_socket_pairThis function is now available on Windows platforms.
 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.
 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.15mysqli_driver::$report_modeChanging the reporting mode is now be per-request, rather than per-process.
5.2.8XSLTProcessor::importStylesheetAccepts SimpleXMLElement again which was broken since PHP 5.2.6.
5.2.7error_logAggiunto il valore 4 per message_type
5.2.5addcslashesSono state aggiunte le sequenze di escape \v e \f.
 debug_backtraceAggiunto il parametro opzionale provide_object.
 imagefilterAlpha support for IMG_FILTER_COLORIZE was added.
5.2.4ldap_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.
 stream_wrapper_registerAdded the flags parameter.
5.2.3getimagesizeRead errors generated by this function downgraded to E_NOTICE from E_WARNING.
 json_decodeThe nesting limit was increased from 20 to 128
 XMLWriter::writeElementThe content parameter became optional.
 XMLWriter::writeElementNSThe content parameter became optional.
 PDOStatement::getColumnMetatable field
5.2.2proc_terminatePrevious versions used to destroy the given process resource.
 token_get_allLine numbers are returned in element 2
5.2.1iterator_to_arrayThe use_keys parameter was added.
 json_decodeAdded support for JSON decoding of basic types.
 memory_get_peak_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.0base64_decodestrict added
 curl_multi_info_readÈ stato aggiunto msgs_in_queue.
 error_reportingInserita E_RECOVERABLE_ERROR.
 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.
 openssl_verifyThe signature_alg parameter was added.
 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.
 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_getinfoIntrodotto CURLINFO_HEADER_OUT.
 get_headersThis function now uses the default stream context, which can be set/changed with the stream_context_set_default function.
 http_build_querySquare brackets are escaped.
 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.2date_default_timezone_setThe function started to validate the timezone_identifier parameter.
 headerThis function now prevents more than one header to be sent at once as a protection against header injection attacks.
 http_build_queryThe arg_separator parameter was added.
 imagepngAdded the quality parameter.
 parse_urlAdded the component parameter.
 SimpleXMLElement::__constructAdded the options and data_is_url parameters.
5.1.1dateCi sono delle costanti utili dei formati di data/ora standard che possono essere usate per specificare il parametro format.
 debug_backtraceAggiunto l'object corrente come possibile elemento di ritorno.
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_digitPrima di PHP 5.1.0, questa stringa restituiva TRUE quando text era una stringa vuota.
 dateL'intervallo valido di un timestamp è tipicamente da Ven, 13 Dec 1901 20:45:54 GMT a Mar, 19 Gen 2038 03:14:07 GMT. (Queste sono le date che corrispondono al valore minimo e massimo per un intero con segno a 32-bit). Tuttavia, prima di PHP 5.1.0 questo intervallo era limitato da 01-01-1970 a 19-01-2038 su alcuni sistemi (es. Windows).
 dateOra emette gli errori time zone E_STRICT e E_NOTICE
 date_sunriseOra emette gli errori time zone E_STRICT e E_NOTICE
 date_sunsetOra emette gli errori time zone E_STRICT e E_NOTICE
 file_put_contentsAdded support for LOCK_EX and the ability to pass a stream resource to the data parameter
 get_parent_classSe venisse chiamata senza parametro fuori dall'oggetto, questa funzione dovrebbe restituire NULL con un avvertimento, ma ora restituisce FALSE.
 globGLOB_ERR was added
 idateOra emette gli errori time zone E_STRICT e E_NOTICE
 imagerotateignore_transparent was added.
 intvalGenera E_NOTICE e restituisce 1, quando un oggetto è passato a var.
 md5_fileModificata la funzione in modo che usi le API di stream. Questo significa che si può utilizzare questa funzione con wrapper, come md5_file('http://example.com/..')
 openssl_pkcs7_verifyThe content parameter was added.
 session_regenerate_idAdded the delete_old_session parameter.
 sha1_fileModificata la funzione per utilizzare lr API streams. Ciò significa che si può utlizzare la funzione con i vari warppers, tipo sha1_file('http://example.com/..')
 str_word_countAggiunto il parametro charlist
 stream_copy_to_streamAdded the offset parameter
 stream_filter_appendPrior to PHP 5.1.0, this function returns TRUE on success o FALSE in caso di fallimento.
 stream_filter_prependPrior to PHP 5.1.0, this function returns TRUE on success o FALSE in caso di fallimento.
 stream_get_contentsThe offset was added.
 var_exportPossibilità di esportare classi e array contenenti classi utilizzando il metodo magico __set_state().
 XSLTProcessor::registerPHPFunctionsThe restrict parameter was added.
5.0.5php_check_syntaxThis function was removed from PHP.
5.0.4msql_fetch_arrayA bug was fixed when retrieving data from columns containing NULL values. Such columns were not placed into the resulting array.
 msql_fetch_objectA bug was fixed when retrieving data from columns containing NULL values. Such columns were not placed into the resulting array.
 msql_fetch_rowA bug was fixed when retrieving data from columns containing NULL values. Such columns were not placed into the resulting array.
5.0.3get_class_varsIn base all'ambito, get_class_vars restituirà solo le proprietà che possono essere accedute dall'ambito corrente.
 is_subclass_ofSi potrebbe anche specificare il parametro object come una stringa (il nome della classe)
 php_check_syntaxCalling exit after php_check_syntax resulted in a Segfault.
5.0.2class_existsNon restituisce più TRUE per le interfacce definite. Utilizzare interface_exists.
 get_class_varsChiamando get_class_vars verranno esposte tutte le proprietà come array, a differenza dei precedenti comportamenti dove le proprietà protected e private erano prefissate con byte nul.
5.0.1get_class_varsChiamando get_class_vars verranno esposte tutte le proprietà, come quando si converte un oggetto in una classe.
 php_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.
 error_reportingInserita E_STRICT (non fa parte di E_ALL).
 is_aQuesta funzione venne deprecata in favore dell'operatore instanceof. La chiamata a questa funzione risulterà in un warning E_STRICT.
 opendirpath accetta il wrapper URL ftp:// .
 sha1_fileAggiunto il parametro raw_output.

Appendici
PHP Manual