找回密码
 新猫注册
查看: 1459|回复: 0

A PHP 5.3.0 upgrade checklist

[复制链接]
kernel 发表于 2009-5-10 12:21:52 | 显示全部楼层 |阅读模式
http://www.hiveminds.co.uk/?p=35862

The PHP development team is proud to announce the second release candidate of PHP 5.3.0 (PHP 5.3.0RC2). This RC focuses on bug fixes and stability improvements, and we hope only minimal changes are required for the next candidate (RC3).

Expect an RC3 in 2-3 weeks, although there will not be major changes so now is a good time to start the final testing of PHP 5.3.0 before it gets released, in order to find possible incompatibilities with your project.

Please download and test this release candidate, and report any issues found. Downloads and further information is available at qa.php.net.
Changes to PHP to take in account when upgrading are listed below.

    * This document is work in progress, and eventually will live in the PHP Manual
    * Add all information, changed behaviour or new features, much like http://php.net/migration52 is for 5.2.0
    * See also undocumented

Changes to the syntax which might break existing applications

    * namespace is now a reserved word. Applications can't use namespace as identifier anymore. Doing so will create a Fatal Error while parsing the script.
    * goto is now a reserved keyword. Applications can't use goto as identifier anymore. Doing so will create a Fatal Error while parsing the script.
    * Closure is now a reserved class. (Used by lambda and closure)

Changes to functions affecting backwards compatibility

    * The functions natsort, natcasesort, usort, uasort, uksort, array_flip, array_unique don't take objects anymore as parameters. For accessing their properties using this way you have to cast the objects to arrays first.
    * var_dump() output with objects (some internal classes emit internal states as private properties that are not accessible otherwise, for Example SimpleXML exposes its virtual properties)
    * session_start() now returns false if session startup fails for some reason.
    * clearstatcache() now defaults to not clear the realpath cache.
    * opendir(), scandir() and dir() now use the default context if no context passed.
    * If a function with by-reference parameters is called by value ( for example with call_user_func_array ) a warning message is produced and all by-reference parameters are set to NULL. In older versions, the function was called with by value parameters.
    * call_user_func now propagates $this even if the callee is the parent class (cf #47402)
    * 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() to produce the following error message: “mysqlnd cannot connect to MySQL 4.1+ using old authentication.”

Changes to method signatures affecting backwards compatibility

    * __get, __set, __isset, __unset, __call magic methods should be public now and can not be static, argument signatures enforced
    * __toString magic method can not accept parameters
    * __callStatic is a new magic method
    * count() vs count_elements handler resolution rules change (might break custom PHP exts not in PECL/php-src)
    * __invoke ('class fail { function __invoke() { echo "hello world\n"; } } $o = new fail; $o();' // hello world)

Changes to binary releases for Windows

    * The minimum Windows versions are now windows 2000/XP (windows 98 or NT4 are not supported anymore)
    * Binaries target 586 or later, i386, i486 are not supported (was already the case before but not mentioned in the manual)

Libraries added

    * mysqlnd (optional replacement for libmysql)

Extensions added

    * Fileinfo
    * Intl
    * Phar
    * SQLite3

Extensions removed
Moved to PECL and maintained there

    * ncurses (maintained)
    * fpdf (maintained)
    * dbase
    * fbsql
    * ming
    * msql

Not maintained and superseded

    * sybase (please use sybase_ct which is maintained and still in core)

Extension Changes Causing Incompatibilities
OCI8

    * Oci_close() on a persistent connection, or all variables referencing a persistent connection going out of scope, now rolls back any uncommitted transaction. Make sure you explicitly commit or rollback as needed. Alternatively, setting oci8.old_oci_close_semantics to On gives the old behavior where oci_close() is a no-op for all types of connection.

Session

    * Sessions would no longer succeed to store session-files in ”/tmp” path if open_basedir restriction is enabled, and ”/tmp” is not explicitly added to allowed paths list (special treatment of ”/tmp” was added in 5.2.2, but was not documented)

Deprecated

    * Ticks (declare(ticks=N) and register_tick_function() now issues E_DEPRECATED )
    * define_syslog_variables() now issues E_DEPRECATED
    * all ereg functions now issues E_DEPRECATED (note that not all of them are prefixed with ereg)

Undeprecated

    * is_a() ( this page says ”[…] but is_a() has since been deprecated in favor of instanceof.”)

Changes to .INI settings

    * Removed zend.ze1_compatibility_mode.
    * user_ini.filename user-initialization mechanism and config variables: user_ini.filename and user_ini.cache_ttl.
    * Added support for special [PATH=/opt/httpd/ www.example.com/ ] and [HOST= www.example.com ] sections. Directives set in these sections can not be overridden by user-defined ini-files or during runtime.
    * Added mbstring.http_output_conv_mimetype that specifies the regex pattern of content types for which mb_output_handler() is activated.
    * Allowed using full path to load modules using “extension” directive.
    * Allowed “ini-variables” to be used almost everywhere ini php.ini files.
    * Allowed using alphanumeric/variable indexes in “array” ini options.
    * Allowed run-time tightening of open_basedir ( http://docs.php.net/manual/en/in ... hp#ini.open-basedir )

No longer allow to disable

    * PCRE
    * Reflection
    * SPL

New parameters

Filesystem

    * fgetcsv() : Added escape .
    * copy() : Added context .
    * parse_ini_file() : Added scanner_mode .
    * clearstatcache() : Added clear_realpath_cache and filename .

Info

    * ini_get_all() : Added details .

JSON

    * json_encode() : Added options .

Math

    * round() : Added mode .

Streams

    * stream_context_create() : Added params .

Strings

    * strstr() , stristr() : Added before_needle .
    * nl2br() : Added is_xhtml .

Exceptions

    * Exception::__construct() : Added previous .

New functions

Array

    * array_replace()
    * array_replace_recursive()

Date

    * date_add()
    * date_sub()
    * date_diff()
    * date_parse_from_format()
    * date_create_from_format()
    * date_get_last_errors()
    * timezone_version_get()

Filesystem

    * Now with Windows support:
          o fnmatch()
          o link()
          o linkinfo()
          o readlink()
          o symlink()
    * parse_ini_string()

GMP

    * gmp_testbit()

Hash

    * hash_copy()

JSON

    * json_last_error()

Image

    * Now with Windows support:
          o imagecolorclosesthwb()

Math

    * Now with native support:
          o asinh()
          o acosh()
          o atanh()
          o log1p()
          o expm1()

Misc

    * Now with Windows support:
          o time_nanosleep()
          o time_sleep_until()

MySQLi

    * mysqli_fetch_all()
    * mysqli_get_connection_stats()
    * mysqli_poll()
    * mysqli_reap_async_query()

Mcrypt

    * Now with Windows support:
          o mcrypt_create_iv()

Network

    * header_remove()
    * Now with Windows support:
          o getmxrr()
          o checkdnsrr()
          o dns_get_record()
          o inet_ntop()
          o inet_pton()

OpenSSL

    * openssl_random_pseudo_bytes()

PCNTL

    * pcntl_signal_dispatch()
    * pcntl_sigprocmask()
    * pcntl_sigwaitinfo()
    * pcntl_sigtimedwait()

PCRE

    * preg_filter()

PHP Core

    * Now with Windows support:
          o getopt()
    * gc_collect_cycles()
    * gc_enabled()
    * gc_enable()
    * gc_disable()
    * class_alias()
    * get_called_class()
    * get_extension_funcs()
    * forward_static_call()
    * forward_static_call_array()
    * str_getcsv()
    * quoted_printable_encode()

SHM

    * msg_queue_exists()

Sockets

    * Now with Windows support (again):
          o socket_create_pair()

SPL

    * trailing / removed from SplFileInfo and other related directory classes
    * SplFileInfo::getpathinfo() returns info on the pathname

Streams

    * stream_supports_lock()
    * stream_context_set_default()
    * Now with Windows support:
          o stream_socket_pair()

Strings

    * lcfirst()

New methods

Date

    * DateTime::diff()
    * DateTime::add()
    * DateTime::sub()
    * DateTime::createFromFormat()
    * DateTime::getLastErrors()

PDO/Firebird

    * PDO::setAttribute()

Reflection

    * ReflectionProperty::setAccessible()
    * ReflectionFunction::getClosureThis()
    * ReflectionFunction::inNamespace()
    * ReflectionFunction::getNamespaceName()
    * ReflectionFunction::getShortName()
    * ReflectionClass::inNamespace()
    * ReflectionClass::getNamespaceName()
    * ReflectionClass::getShortName()

XSL

    * XSLTProcessor::setProfiling()

New classes

Date

    * DateInterval
    * DatePeriod

Phar

    * Phar
    * PharData
    * PharFileInfo
    * PharException

SPL

    * SplDoublyLinkedList
    * SplStack
    * SplQueue
    * SplHeap
    * SplMinHeap
    * SplMaxHeap
    * SplPriorityQueue
    * SplFixedArray
    * FilesystemIterator
    * GlobIterator
    * RecursiveTreeIterator
    * MultipleIterator

New global constants

Filesystem

    * INI_SCANNER_NORMAL
    * INI_SCANNER_RAW

GD

    * IMG_FILTER_PIXELATE

JSON

    * JSON_ERROR_NONE
    * JSON_ERROR_DEPTH
    * JSON_ERROR_STATE_MISMATCH
    * JSON_ERROR_CTRL_CHAR
    * JSON_ERROR_SYNTAX

LDAP

    * LDAP_OPT_NETWORK_TIMEOUT

PCRE

    * PREG_BAD_UTF8_OFFSET_ERROR

PHP Core

    * E_DEPRECATED
    * E_USER_DEPRECATED
    * __DIR__
    * __NAMESPACE__

PCNTL

    * “how” argument in pcntl_sigprocmask()
          o SIG_BLOCK
          o SIG_UNBLOCK
          o SIG_SETMASK
    * Value of “code” in the argument “info” set by reference by pcntl_sigwaitinfo() and pcntl_sigtimedwait()
          o SI_USER
          o SI_NOINFO
          o SI_KERNEL
          o SI_QUEUE
          o SI_TIMER
          o SI_MESGQ
          o SI_ASYNCIO
          o SI_SIGIO
          o SI_TKILL
          o CLD_EXITED
          o CLD_KILLED
          o CLD_DUMPED
          o CLD_TRAPPED
          o CLD_STOPPED
          o CLD_CONTINUED
          o TRAP_BRKPT
          o TRAP_TRACE
          o POLL_IN
          o POLL_OUT
          o POLL_MSG
          o POLL_ERR
          o POLL_PRI
          o POLL_HUP
          o ILL_ILLOPC
          o ILL_ILLOPN
          o ILL_ILLADR
          o ILL_ILLTRP
          o ILL_PRVOPC
          o ILL_PRVREG
          o ILL_COPROC
          o ILL_BADSTK
          o FPE_INTDIV
          o FPE_INTOVF
          o FPE_FLTDIV
          o FPE_FLTOVF
          o FPE_FLTUND
          o FPE_FLTRES
          o FPE_FLTINV
          o FPE_FLTSUB
          o SEGV_MAPERR
          o SEGV_ACCERR
          o BUS_ADRALN
          o BUS_ADRERR
          o BUS_OBJERR

New class constants

PDO/Firebird

    * PDO::FB_ATTR_DATE_FORMAT
    * PDO::FB_ATTR_TIME_FORMAT
    * PDO::FB_ATTR_TIMESTAMP_FORMAT

New stream wrappers

Phar

    * Phar stream wrapper for accessing phar archives

Streams

    * Added “glob” stream wrapper

Other informations

GD

    * Added pixelation support through imagefilter()

Hash

    * Added sha224 hash algorithm to the hash extension.

OpenSSL

    * Added support for OpenSSL digest and cipher functions.
    * Added access to internal values of DSA, RSA and DH keys.

PHP Core

    * crypt()
          o Added Blowfish and extended DES support.
          o Made crypt features 100% portable.
                + MD5 crypt, standard DES, extended DES as well as the new Blowfish algorithms are not always available. PHP contains its own implementation and will use it as soon as libc's libcrypt is lacking any of them or the crypt_r function
    * Fixed get_cfg_var() to be able to return “array” ini options.

SAPI

    * FastCGI is now always enabled and can not be disabled. (See sapi/cgi/CHANGES for more details)
    * Added CGI SAPI -T option which can be used to measure execution time of script repeated several times.
    * Added ”.htaccess” style user-defined php.ini files support for CGI /FastCGI.

SPL

    * Added ArrayAccess support to SplObjectStorage.
    * Added ability to store associative information with objects in SplObjectStorage.

Streams

    * Added ability to use stream wrappers in include_path.

Windows Support

    * Improve portability of stat, touch, filemtime, filesize and related functions (100% portable for the available data)

New syntactic sugar

NOWDOC

    * <<<'LABEL' ...

HEREDOC with double quotes

    * <<<"LABEL" ...

Static HEREDOCs can now be used to initialize static variables and class members or constants (like NOWDOC)

    * static $foo = <<<LABEL No variables here... LABEL;

?: operator

    * var_dump(0 ?: 'Hello!');
您需要登录后才可以回帖 登录 | 新猫注册

本版积分规则

手机版|小黑屋|[漫猫]动漫论坛

GMT+8, 2024-11-21 16:42

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表