$Id: UPGRADING 308266 2011-02-11 22:31:52Z salathe $ UPGRADE NOTES - PHP 5.3 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 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 ============================= 1. Reserved words and classes ============================= - **namespace** and **goto** are now reserved keywords. - **Closure** is now a reserved class. (Used by lambda and closure.) ===================================== 2. Changes made to existing functions ===================================== - Paths containing NULL (like /some/path\0foo.txt) are now considered invalid. See http://news.php.net/php.internals/50191 - The HTTP stream wrapper now considers all status codes from 200 to 399 to be successful. - 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. - var_dump() output now includes private object members. - session_start() now returns FALSE when the session startup fails. - property_exists() now checks the existence of a property independent of accessibility (like method_exists()). - The $initial parameter for array_reduce can now be of any type. - clearstatcache() no longer clears the realpath cache by default. - realpath() is no longer system-dependent and works identically on all platforms. - call_user_func() now propagates $this even if the callee is the parent class. - The filesystem functions opendir(), scandir(), and dir() now use the default context if no context argument is passed. - 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. - There is now native support for the following math functions: asinh(), acosh(), atanh(), log1p(), and expm1(). - In the GD extension, there is now pixelation support available through the imagefilter() function. - 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. - get_cfg_var() is now able to return "array" INI options. - Stream wrappers can now be used by the include_path INI directive. - 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 - And new mode option for fopen: 'n' (O_NONBLOCK) - 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" - The dl() function is now disabled by default, and only available under the cli, cgi, and embed SAPIs. - mail() now supports the logging of sent mail. - stream_select(), stream_set_blocking(), stream_set_timeout(), and stream_set_write_buffer() now work with user-space stream wrappers. - getopt() accepts "long options" now on all platforms. Optional values and using = as a separator for short options are now supported. =================================== 3. Changes made to existing methods =================================== - The magic methods __get(), __set(), __isset(), __unset(), and __call() should always be public and can no longer be static. Method signatures are enforced. - The __call() magic method is now invoked on access to private and protected methods. - The __toString() magic method can no longer accept arguments. - There is a new magic method, __callStatic(). - Internal count() vs. count_elements() handler resolution rules have changed. (This could potentially break custom PHP extensions.) - The trailing / has been removed from SplFileInfo and other related directory classes. - SplFileInfo::getpathinfo() now returns information about the path name. - There are new parameters in: Exception::__construct(): $previous =================================== 4. Changes made to existing classes =================================== - SplObjectStorage now has ArrayAccess support. It is also now possible to store associative information with objects in SplObjectStorage. ============= 5. Deprecated ============= - define_syslog_variables() is deprecated. - set_socket_blocking() is deprecated. - call_user_method() and call_user_method_array() are now deprecated. Use call_user_func() and call_user_func_array() instead. - dl() is deprecated. - The set_magic_quotes_runtime() function is now deprecated. - mysql_listtables(), mysql_dropdb(), mysql_createdb(), mysql_list_tables(), mysql_drop_db(), and mysql_create_db() are now deprecated. - All ereg functions are now deprecated and emit E_DEPRECATED errors: sql_regcase(), spliti(), split(), ereg_replace(), eregi(), ereg_replace(), and ereg(). Use the PCRE family of functions (preg_*()) instead. - mcrypt_generic_end() is deprecated. - mysql_db_query() is deprecated. - mysql_escape_string() is deprecated. - session_register(), session_unregister(), and session_is_registered() are now deprecated. Use the $_SESSION superglobal array instead. - Comments starting with '#' are now deprecated in .INI files. - The following INI directives will now emit an E_DEPRECATED warning upon startup if they are activated: - define_syslog_variables - register_globals - register_long_arrays - safe_mode - magic_quotes_gpc - magic_quotes_runtime - magic_quotes_sybase - The is_dst parameter to mktime() is deprecated. - Assigning the return value of "new" by reference is deprecated - Call-time pass-by-reference has been deprecated - Usage of {} to access string offsets is deprecated - Passing locale category name as string to setlocale() is deprecated. =============== 6. Undeprecated =============== - By popular request, is_a() is no longer deprecated. ============== 7. Extensions: ============== a. moved out to PECL and actively maintained there - fdf - ming - ncurses b. no longer maintained - 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) c. with changed behaviour - dns: dns_check_record() will now return an extra "entries" index, containing the TXT elements. - datetime: date/time functions will no longer use the TZ environment variable to guess which timezone should be used. - cURL now supports SSH - hash: The SHA-224 and salsa hash algorithms are now supported. - mbstring: Now supports CP850 encoding. - oci8: Database Resident Connection Pooling (DRCP) and Fast Application Notification (FAN) are now supported. Oracle External Authentication is now supported (except on Windows). The oci8 function oci_bind_by_name() now supports SQLT_AFC (aka the CHAR datatype). 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. - 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. - 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. - SOAP: Now supports sending user-supplied HTTP headers. - MySQLi: Now supports persistent connections by prepending the hostname with "p:". - imagepstext now rejects invalid antialiasing steps and raises a warning. d. no longer possible to disable - PCRE - Reflection - SPL ========================== 8. Changes in SAPI support ========================== - A new "litespeed" SAPI is now available. - FastCGI is now always enabled and can not be disabled. See sapi/cgi/CHANGES for more details. - 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. ============================ 9. Changes in INI directives ============================ - zend_extension_debug and zend_extension_ts have been removed. Always use the zend_extension directive to load Zend Extensions. - zend.ze1_compatibility_mode has been removed. If this INI directive is set to on, then an E_ERROR is emitted at startup. - 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. - Added mbstring.http_output_conv_mimetype. This directive specifies the regex pattern of content types for which mb_output_handler() is activated. - It is now possible to use the full path to load modules using the "extension" directive. - "INI variables" can now be used almost anywhere in a php.ini file. - It is now possible to use alphanumeric or variable indices in INI option arrays. - open_basedir is now PHP_INI_ALL - Runtime tightening of open_basedir restrictions is now possible. - The default value of session.use_only_cookies has changed to "1". - The default value of oci8.default_prefetch has been changed from 10 to 100. - A new directive, request_order, controls the behavior of $_REQUEST independently of variables_order. - 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 ==================== 10. Syntax additions ==================== - NOWDOC: Similar to HEREDOC, but with single quotes: <<<'LABEL' ... Static HEREDOCs can be used to initialize static variables and class members or constants: static $foo = <<