--- embedaddon/php/UPGRADING 2012/02/21 23:47:51 1.1.1.1 +++ embedaddon/php/UPGRADING 2012/05/29 12:34:34 1.1.1.2 @@ -1,700 +1,785 @@ -$Id: UPGRADING,v 1.1.1.1 2012/02/21 23:47:51 misho Exp $ +$Id: UPGRADING,v 1.1.1.2 2012/05/29 12:34:34 misho Exp $ -UPGRADE NOTES - PHP 5.3 +PHP 5.4 UPGRADE NOTES -1. Reserved words and classes -2. Changes made to existing functions -3. Changes made to existing methods -4. Changes made to existing classes -5. Deprecated -6. Undeprecated -7. Extensions: - a. moved out to PECL and actively maintained there - b. no longer maintained - c. with changed behaviour - d. no longer possible to disable -8. Changes in SAPI support -9. Changes in INI directives -10. Syntax additions +=========== +0. Contents +=========== + +1. Changes to INI directives +2. Changes to reserved words and classes +3. Changes to engine behavior +4. Changes to existing functions +5. Changes to existing classes +6. Changes to existing methods +7. Deprecated Functionality +8. Removed Functionality + a. Removed features + b. Removed functions + c. Removed syntax + d. Removed hash algorithms +9. Extension Changes: + a. Extensions no longer maintained + b. Extensions with changed behavior +10. Changes in SAPI support 11. Windows support -12. New in PHP 5.3: - a. New libraries - b. New extensions - c. New stream wrappers - d. New stream filters - e. New functions - f. New global constants - g. New classes - h. New methods - i. New class constants +12. New in PHP 5.4: + a. New features + b. Syntax additions + c. New functions + d. New global constants + e. New classes + f. New methods + g. New hash algorithms ============================= -1. Reserved words and classes +1. Changes to INI directives ============================= -- **namespace** and **goto** are now reserved keywords. +- PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom + are present. If either is available, session.entropy_file now + defaults to that file and session.entropy_length defaults to 32. + This provides non-blocking entropy to session id generation. If you + do not want extra entropy for your session ids, add: -- **Closure** is now a reserved class. (Used by lambda and closure.) + session.entropy_file= + session.entropy_length=0 -===================================== -2. Changes made to existing functions -===================================== + to your php.ini to preserve pre-PHP 5.4 behavior. -- Paths containing NULL (like /some/path\0foo.txt) are now considered invalid. - See http://news.php.net/php.internals/50191 +- Deprecated php.ini directives will now throw an E_CORE_WARNING's + instead of the previous E_WARNING's. -- The HTTP stream wrapper now considers all status codes from 200 to 399 to be - successful. +- The following php.ini directives are no longer available in PHP 5.4 + and will now throw an E_CORE_ERROR upon startup: + - allow_call_time_pass_reference + - define_syslog_variables + - highlight.bg + - magic_quotes_gpc + - magic_quotes_runtime + - magic_quotes_sybase + - register_globals + - register_long_arrays + - safe_mode + - safe_mode_gid + - safe_mode_include_dir + - safe_mode_exec_dir + - safe_mode_allowed_env_vars + - safe_mode_protected_env_vars + - session.bug_compat_42 + - session.bug_compat_warn + - y2k_compliance + - zend.ze1_compatibility_mode -- The array functions natsort(), natcasesort(), usort(), uasort(), uksort(), - array_flip(), and array_unique() no longer accept objects passed as arguments. - If you need to use them to access an object's properties, you must cast the - object to an array first. +- the following new php.ini directives were added: + - max_input_vars - specifies how many GET/POST/COOKIE input + variables may be accepted. The default value is 1000. -- var_dump() output now includes private object members. +- E_ALL now includes E_STRICT. -- session_start() now returns FALSE when the session startup fails. +- The recommended production value for error_reporting changed to E_ALL & + ~E_DEPRECATED & ~E_STRICT. -- property_exists() now checks the existence of a property independent of - accessibility (like method_exists()). +- Added new session support directives: + session.upload_progress.enabled + session.upload_progress.cleanup + session.upload_progress.prefix + session.upload_progress.name + session.upload_progress.freq + session.upload_progress.min_freq -- The $initial parameter for array_reduce can now be of any type. +- Added a zend.multibyte directive as a replacement of the PHP compile time + configuration option --enable-zend-multibyte. Now the Zend Engine always + contains code for multibyte support, which can be enabled or disabled at + runtime. Note: It doesn't make a lot of sense to enable this option if + ext/mbstring is not enabled, because most functionality is implemented by + mbstrings callbacks. -- clearstatcache() no longer clears the realpath cache by default. +- Added zend.script_encoding. This value will be used unless a + "declare(encoding=...)" directive appears at the top of the script. -- realpath() is no longer system-dependent and works identically on all - platforms. +- Added zend.signal_check to check for replaced signal handlers on shutdown -- call_user_func() now propagates $this even if the callee is the parent class. +- Added enable_post_data_reading, which is enabled by default. When it's + disabled, the POST data is not read (or processed); the behavior is similar + to that of other request methods with body, like PUT. This allows reading + the raw POST data in multipart requests and reading/processing the POST data + in a stream fashion (through php://input) without having it copied in memory + multiple times. -- The filesystem functions opendir(), scandir(), and dir() now use the default - context if no context argument is passed. +- Added windows_show_crt_warning. This directive shows the CRT warnings when + enabled. These warnings were displayed by default until now. It is disabled + by default. -- The behaviour of functions with by-reference parameters called by value has - changed. Where previously the function would accept the by-value argument, a - warning is now emitted and all by-ref parameters are set to NULL. +- Added cli.pager to set a pager for CLI interactive shell output. -- There is now native support for the following math functions: asinh(), - acosh(), atanh(), log1p(), and expm1(). +- Added cli.prompt to configure the CLI interactive shell prompt. -- In the GD extension, there is now pixelation support available through - the imagefilter() function. +- Added cli_server.color to enable the CLI web server to use ANSI color coding + in terminal output. -- crypt() now has Blowfish and extended DES support, and crypt() features are - now 100% portable. PHP has its own internal crypt implementation which drops - into place when system support for crypt or crypt_r() is not found. +======================================== +2. Changes to reserved words and classes +======================================== -- get_cfg_var() is now able to return "array" INI options. +- "callable", "insteadof" and "trait" are now reserved words. -- Stream wrappers can now be used by the include_path INI directive. +============================= +3. Changes to engine behavior +============================= -- These functions now take new parameters: - clearstatcache(): $clear_realpath_cache and $filename. - copy(): $context - fgetcsv(): $escape - ini_get_all(): $details - json_encode(): $options - json_decode(): $depth - nl2br(): $is_xhtml - parse_ini_file(): $scanner_mode - round(): $mode - stream_context_create(): $params - strstr(), stristr(): $before_needle - sybase_connect(): $new +- The __construct arguments of an extended abstract constructor must + now match: -- And new mode option for fopen: 'n' (O_NONBLOCK) + abstract class Base + { + abstract public function __construct(); + } + class Foo extends Base + { + public function __construct($bar) {} + } -- The new mysqlnd library necessitates using MySQL's newer 41-byte password - format. Continued use of the old 16 byte passwords will cause mysql_connect() - and other related functions to produce the following error message: - "mysqlnd cannot connect to MySQL 4.1+ using old authentication" + This now emits a Fatal error due the incompatible declaration. -- The dl() function is now disabled by default, and only available under the - cli, cgi, and embed SAPIs. +- In previous versions, superglobal names could be used for parameter + names, thereby shadowing the corresponding superglobal. In PHP 5.4 + this now causes a fatal error such as "Cannot re-assign auto-global + variable GLOBALS". -- mail() now supports the logging of sent mail. +- Turning null, false or an empty string into an object by adding a + property will now emit a warning instead of an E_STRICT error. -- stream_select(), stream_set_blocking(), stream_set_timeout(), and - stream_set_write_buffer() now work with user-space stream wrappers. + $test = null; + $test->baz = 1; -- getopt() accepts "long options" now on all platforms. - Optional values and using = as a separator for short options are now - supported. + To create a generic object you can use StdClass: + $test = new StdClass; + $test->baz = 1; -=================================== -3. Changes made to existing methods -=================================== +- Converting an array to a string now will cause an E_NOTICE warning. -- The magic methods __get(), __set(), __isset(), __unset(), and __call() should - always be public and can no longer be static. Method signatures are enforced. +- Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now + return false on isset() and true on empty(), and produce warning if + trying to use them. Offsets of types double, bool and null produce + notice. Numeric strings ($a['2']) still work as before. -- The __call() magic method is now invoked on access to private and protected - methods. + Note that offsets like '12.3' and '5 and a half' are considered + non-numeric and produce warning, but are converted to 12 and 5 + respectively for backwards compatibility reasons. -- The __toString() magic method can no longer accept arguments. +- Closures now support scopes and $this and can be rebound to + objects using Closure::bind() and Closure::bindTo(). -- There is a new magic method, __callStatic(). +- 1; it doesn't merely + decrement the resource refcount. - - define_syslog_variables - - register_globals - - register_long_arrays - - safe_mode - - magic_quotes_gpc - - magic_quotes_runtime - - magic_quotes_sybase +- socket_set_options() and socket_get_options() now support multicast options. -- The is_dst parameter to mktime() is deprecated. +- The raw data parameter in openssl_encrypt() and openssl_decrypt() is now an + options integer rather than a boolean. A value of true produces the same + behavior. -- Assigning the return value of "new" by reference is deprecated +- Write operations within XSLT (for example with the extension sax:output) are + disabled by default. You can define what is forbidden with the method + XsltProcess::setSecurityPrefs($options). -- Call-time pass-by-reference has been deprecated +- Added AES support to OpenSSL. -- Usage of {} to access string offsets is deprecated +- openssl_csr_new() expects the textual data to be in UTF-8. -- Passing locale category name as string to setlocale() is deprecated. +- Added no-padding option to openssl_encrypt() and openssl_decrypt(). -=============== -6. Undeprecated -=============== +- Added a "no_ticket" SSL context option to disable the SessionTicket TLS + extension. -- By popular request, is_a() is no longer deprecated. +- Added new json_encode() options: JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, + JSON_NUMERIC_CHECK, JSON_BIGINT_AS_STRING, JSON_UNESCAPED_UNICODE. -============== -7. Extensions: -============== +- Added Tokyo Cabinet and Berkley DB 5 support to DBA extension. - a. moved out to PECL and actively maintained there +- Added support for CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE + to cURL. - - fdf - - ming - - ncurses +- Added optional argument to debug_backtrace() and debug_print_backtrace() + to limit the amount of stack frames returned. - b. no longer maintained +- Fixed crypt_blowfish handling of 8-bit characters. crypt() in Blowfish mode + now supports hashes marked $2a$, $2x$, $2y$ and $2z$. - - dbase - - fbsql - - msql - - sybase (use sybase_ct, which is still in PHP core) - - mhash (hash has full BC layer) - - mime_magic (use fileinfo, has full BC layer) +- mbstring now supports following encodings: Shift_JIS/UTF-8 Emoji, + JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004), + MacJapanese (Shift_JIS), gb18030. - c. with changed behaviour +- Added encode and decode in hex format to mb_encode_numericentity() and + mb_decode_numericentity(). - - dns: dns_check_record() will now return an extra "entries" index, - containing the TXT elements. +- Added support for SORT_NATURAL and SORT_FLAG_CASE in array sort functions: + sort(), rsort(), ksort(), krsort(), asort(), arsort() and array_multisort(). - - datetime: date/time functions will no longer use the TZ environment - variable to guess which timezone should be used. +- is_a() and is_subclass_of() now have third boolean parameter, which specifies + if the first argument can be a string class name. Default if false for is_a + and true for is_subclass_of() for BC reasons. - - cURL now supports SSH +- ob_start() will now treat a chunk size of 1 as meaning 1 byte, rather than + the previous special case behavior of treating it as 4096 bytes. - - hash: The SHA-224 and salsa hash algorithms are now supported. +- idn_to_ascii() and idn_to_utf8() now take two extra parameters, one indicating + the variant (IDNA 2003 or UTS #46) and another, passed by reference, to return + details about the operation in case UTS #46 is chosen. - - mbstring: Now supports CP850 encoding. +- gzencode() used with FORCE_DEFLATE now generates RFC1950 compliant data. - - oci8: Database Resident Connection Pooling (DRCP) and Fast Application - Notification (FAN) are now supported. +- ob_start() no longer starts multiple output buffers when passed + array("callback1", "callback2", "callback3", ...). - Oracle External Authentication is now supported (except on Windows). +============================== +5. Changes to existing classes +============================== - The oci8 function oci_bind_by_name() now supports SQLT_AFC (aka the - CHAR datatype). +- Classes that implement stream wrappers can define a method called + stream_truncate that will respond to truncation, e.g. through ftruncate. + Strictly speaking, this is an addition to the user-space stream wrapper + template, not a change to an actual class. - Calling oci_close() on a persistent connection, or when the variable - that references a persistent connection goes out of scope, will now - trigger a roll back of an uncommitted transaction. To avoid unexpected - behavior explicitly issue a commit or roll back as needed. The old - behavior can be enabled with the INI directive - oci8.old_oci_close_semantics. +- Classes that implement stream wrappers can define a method called + stream_metadata that will be called on touch(), chmod(), chgrp(), chown(). - - openssl: OpenSSL digest and cipher functions are now supported. - It is also now possible to access the internal values of DSA, RSA and - DH keys. +- Arrays cast from SimpleXMLElement now always contain all nodes instead of + just the first matching node. - - session: Sessions will no longer store session-files in "/tmp" when - open_basedir restrictions apply, unless "/tmp" is explicitly added to - the list of allowed paths. +- All SimpleXMLElement children are now always printed when using var_dump(), + var_export(), and print_r(). - - SOAP: Now supports sending user-supplied HTTP headers. +- Added iterator support in MySQLi. mysqli_result implements Traversable. - - MySQLi: Now supports persistent connections by prepending the hostname - with "p:". +============================== +6. Changes to existing methods +============================== - - imagepstext now rejects invalid antialiasing steps and raises a warning. +- DateTime::parseFromFormat() now has a "+" modifier to allow trailing text in + the string to parse without throwing an error. - d. no longer possible to disable +- Added the ability to pass options to DOMDocument::loadHTML(). - - PCRE - - Reflection - - SPL +- FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use + the default stream context. -========================== -8. Changes in SAPI support -========================== +=========================== +7. Deprecated Functionality +=========================== -- A new "litespeed" SAPI is now available. +- The following functions are deprecated in PHP 5.4: + - mcrypt_generic_end(): use mcrypt_generic_deinit() instead + - mysql_list_dbs() -- FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES - for more details. +======================== +8. Removed Functionality +======================== -- A new CGI SAPI option, -T, can be used to measure execution time of a script - repeated several times. - -- CGI/FastCGI now has support for .htaccess style user-defined php.ini files. - See the new user_ini.filename and user_ini.cache_ttl INI directives. +a. Removed features -============================ -9. Changes in INI directives -============================ + The following features have been removed from PHP 5.4: -- zend_extension_debug and zend_extension_ts have been removed. Always use the - zend_extension directive to load Zend Extensions. + - Magic quotes + - Register globals + - Safe mode + - Session extension bug compatibility mode + - Y2K compliance mode -- zend.ze1_compatibility_mode has been removed. If this INI directive is set to - on, then an E_ERROR is emitted at startup. +b. Removed functions -- There is now support for special sections: [PATH=/opt/httpd/www.example.com/] - and [HOST=www.example.com]. Directives set in these sections cannot be - overridden by user-defined INI files or at runtime. + The following functions are no longer available in PHP 5.4: -- Added mbstring.http_output_conv_mimetype. This directive specifies the - regex pattern of content types for which mb_output_handler() is activated. + - define_syslog_variables() + - import_request_variables() + - session_is_registered() + - session_register() + - session_unregister() + - set_magic_quotes_runtime() + - mysqli_bind_param() (alias of mysqli_stmt_bind_param()) + - mysqli_bind_result() (alias of mysqli_stmt_bind_result()) + - mysqli_client_encoding() (alias of mysqli_character_set_name()) + - mysqli_fetch() (alias of mysqli_stmt_fetch()) + - mysqli_param_count() (alias of mysqli_stmt_param_count()) + - mysqli_get_metadata() (alias of mysqli_stmt_result_metadata()) + - mysqli_send_long_data() (alias of mysqli_stmt_send_long_data()) + - mysqli::client_encoding() (alias of mysqli::character_set_name) + - mysqli_stmt::stmt() (never worked/always throws, undocumented) -- It is now possible to use the full path to load modules using the "extension" - directive. +c. Removed syntax -- "INI variables" can now be used almost anywhere in a php.ini file. + - break $var; + - continue $var; -- It is now possible to use alphanumeric or variable indices in INI option - arrays. +d. Removed hash algorithms -- open_basedir is now PHP_INI_ALL + - Salsa10 and Salsa20, which are actually stream ciphers -- Runtime tightening of open_basedir restrictions is now possible. +==================== +9. Extension Changes +==================== -- The default value of session.use_only_cookies has changed to "1". +a. Extensions no longer maintained -- The default value of oci8.default_prefetch has been changed from 10 to 100. + - ext/sqlite is no longer part of the base distribution and has been moved + to PECL. Use sqlite3 or PDO_SQLITE instead. -- A new directive, request_order, controls the behavior of $_REQUEST - independently of variables_order. -- A new directive, called windows.show_crt_warning, has been introduced. - This directive shows the CRT warnings when enabled. These warnings were - displayed by default until now. It is disabled by default. +b. Extensions with changed behavior -- New INI directives: - - mail.add_x_header - - user_ini.filename - - user_ini.cache_ttl - - exit_on_timeout - - mysqli.allow_persistent - - mysqli.default_host - - mysqli.default_socket - - mysqli.allow_local_infile - - mysqli.cache_size - - oci8.connection_class - - oci8.events - - pdo_mysql.default_socket - - pdo_mysql.cache_size - - sqlite3.extension_dir - - mysql.default_socket - - mysql.allow_local_infile - - mysql.cache_size - - mysqlnd.collect_statistics - - mysqlnd.collect_memory_statistics - - mysqlnd.net_cmd_buffer_size - - mysqlnd.net_read_buffer_size - - mysqlnd.log_mask + - The MySQL extensions (ext/mysql, mysqli and PDO_MYSQL) use mysqlnd + as the default library now. It is still possible to use libmysql by + specifying a path to the configure options. + - PDO_MYSQL: Support for linking with MySQL client libraries older + than 4.1 is removed. -==================== -10. Syntax additions -==================== + - The session extension now can hook into the file upload feature + in order to provide upload progress information through session + variables. -- NOWDOC: Similar to HEREDOC, but with single quotes: + - SNMP extension + - Functions in SNMP extension now returns FALSE on every error + condition including SNMP-related (no such instance, end of MIB, + etc). Thus, in patricular, breaks previous behavior of get/walk + functions returning an empty string on SNMP-related errors. + - Multi OID get/getnext/set queries are now supported. + - New constants added for use in snmp_set_oid_output_format() + function. + - Function snmp_set_valueretrieval() changed it's behavior: + SNMP_VALUE_OBJECT can be combined with one of + SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY resulting OID value + changes. When no SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY + is supplied with SNMP_VALUE_OBJECT, SNMP_VALUE_LIBRARY is used. + Prior to 5.4.0 when no SNMP_VALUE_PLAIN or SNMP_VALUE_LIBRARY + was supplied with SNMP_VALUE_OBJECT, SNMP_VALUE_PLAIN was used. + - Added feature-rich OO API (SNMP class) + - Dropped UCD-SNMP compatibility code. Consider upgrading to + net-snmp v5.3+. Net-SNMP v5.4+ is required for Windows version. + - In sake of adding support for IPv6 DNS name resolution of + remote SNMP agent (peer) is done by extension now, not by Net-SNMP + library anymore. - <<<'LABEL' ... + - Date extension + - Setting the timezone with the TZ environment variable is no longer + supported, instead date.timezone and/or date_default_timezone_set() + have to be used. + - The extension will no longer guess the default timezone if none + is set with date.timezone and/or date_default_timezone_set(). + Instead it will always fall back to "UTC". - Static HEREDOCs can be used to initialize static variables and class members - or constants: + - Hash extension + - the output of the tiger hash family has been corrected, see + https://bugs.php.net/61307 - static $foo = <<