initial commit
[m6w6/m6w6.github.io] / _posts / 2005-11-13-php-51-around-the-corner.md
1 ---
2 title: PHP-5.1 around the corner
3 author: m6w6
4 tags:
5 - PHP
6 ---
7
8 Here's a tidied up excerpt of the current NEWS file with all relevant changes
9 since PHP 5.0, which may help on the decision to upgrade (even from PHP 4 :))
10
11 ### Fixes
12
13 * More than 350
14
15 ### Changes
16
17 * Changed PDO constants to class constants (PDO::CONST_NAME)
18 * Changed SQLite extension to be a shared module in Windows distribution
19 * Changed "instanceof" and "catch" operators, [is_a](http://php.net/is_a)() and [is_subclass_of](http://php.net/is_subclass_of)() functions to not call [__autoload](http://php.net/__autoload)()
20 * Changed [sha1_file](http://php.net/sha1_file)() and [md5_file](http://php.net/md5_file)() functions to use streams instead of low level IO
21 * Changed abstract private methods to be not allowed anymore
22 * Changed [stream_filter_(ap|pre)pend](http://php.net/stream_filter_append)() to return resource
23 * Changed mysqli_exception and sqlite_exception to use RuntimeException as base if SPL extension is present
24
25 ### Extensions moved to [PECL](http://pecl.php.net)
26
27 * cpdf
28 * dio
29 * fam
30 * ingres_ii
31 * mcve
32 * mnogosearch
33 * oracle
34 * ovrimos
35 * pfpro
36 * w32api
37 * yp
38
39 ### Upgraded [PEAR](http://pear.php.net)
40
41 * to channel-featuring v1.4### Upgraded bundled libraries
42
43 ### Upgraded bundled libraries
44
45 * PCRE library to version 6.2
46 * SQLite 3 library in ext/pdo_sqlite to 3.2.7
47 * SQLite 2 library in ext/sqlite to 2.8.16### Upgraded bundled libraries in Windows distribution
48
49 ### Upgraded bundled libraries in Windows distribution
50 * zlib 1.2.3
51 * curl 7.14.0
52 * openssl 0.9.8
53 * ming 0.3b
54 * libpq (PostgreSQL) 8.0.1
55
56 ### Improvements and Additions
57
58 * Improved SPL extension
59 * Moved RecursiveArrayIterator from examples into extension
60 * Moved RecursiveFilterIterator from examples into extension
61 * Added SplObjectStorage
62 * Made all SPL constants class constants
63 * Renamed CachingRecursiveIterator to RecursiveCachingIterator to follow Recursive<*>Iterator naming scheme
64 * Added support for class constants and static members for internal classes
65 * Added PDO::MYSQL_ATTR_USE_BUFFERED_QUERY parameter for pdo_mysql
66 * Added [date_timezone_set](http://php.net/date_timezone_set)() function to set the timezone that the date functions will use
67 * Added [pg_fetch_all_columns](http://php.net/pg_fetch_all_columns)() function to fetch all values of a column from a result cursor
68 * Added support for LOCK_EX flag for [file_put_contents](http://php.net/file_put_contents)()
69 * Implemented feature request [#33452](http://bugs.php.net/33452)
70 * Improved PHP extension loading mechanism with support for module dependencies and conflicts
71 * Allowed return by reference from internal functions
72 * Rewrote [strtotime](http://php.net/strtotime)() with support for timezones and many new formats. Implements feature requests [#21399](http://bugs.php.net/21399), [#26694](http://bugs.php.net/26694), [#28088](http://bugs.php.net/28088), [#29150](http://bugs.php.net/29150), [#29585](http://bugs.php.net/29585) and [#29595](http://bugs.php.net/29595)
73 * Added bindto socket context option
74 * Added offset parameter to the [stream_copy_to_stream](http://php.net/stream_copy_to_stream)() function
75 * Added offset & length parameters to [substr_count](http://php.net/substr_count)() function
76 * Removed [php_check_syntax](http://php.net/php_check_syntax)() function which never worked properly
77 * Removed garbage manager in Zend Engine which results in more aggressive freeing of data
78 * [Improved interactive mode of PHP CLI](http://blog.thinkphp.de/archives/44-More-PHP-power-on-the-command-line.html)
79 * Improved performance of:
80 * general execution/compilation
81 * [switch](http://php.net/switch)() statement
82 * several array functions
83 * virtual path handling by adding a [realpath](http://php.net/realpath)() cache
84 * variable fetches
85 * magic method invocations
86 * Improved support for embedded server in mysqli
87 * Improved mysqli extension
88 * added constructor for mysqli_stmt and mysqli_result classes
89 * added new function [mysqli_get_charset](http://php.net/mysqli_get_charset)()
90 * added new function [mysqli_set_charset](http://php.net/mysqli_set_charset)()
91 * added new class mysqli_driver
92 * added new class mysqli_warning
93 * added new class mysqli_execption
94 * added new class mysqli_sql_exception
95 * Improved SPL extension
96 * added standard hierarchy of Exception classes
97 * added interface Countable
98 * added interfaces Subject and Observer
99 * added spl_autoload*() functions
100 * converted several 5.0 examples into c code
101 * added class FileObject
102 * added possibility to use a string with [class_parents](http://php.net/class_parents)() and [class_implements](http://php.net/class_implements)()
103 * Added man pages for "phpize" and "php-config" scripts
104 * Added support for .cc files in extensions
105 * Added PHP_INT_MAX and PHP_INT_SIZE as predefined constants
106 * Added user opcode API that allow overloading of opcode handlers
107 * Added an optional remove old session parameter to [session_regenerate_id](http://php.net/session_regenerate_id)()
108 * Added array type hinting
109 * Added the [tidy_get_opt_doc](http://php.net/tidy_get_opt_doc)() function to return documentation for configuration options in tidy
110 * Added support for .cc files in extensions
111 * Added [imageconvolution](http://php.net/imageconvolution)() function which can be used to apply a custom 3x3 matrix convolution to an image
112 * Added optional first parameter to XsltProcessor::registerPHPFunctions to only allow certain functions to be called from XSLT
113 * Added the ability to override the autotools executables used by the buildconf script via the PHP_AUTOCONF and PHP_AUTOHEADER environmental variables
114 * Added several new functions to support the PostgreSQL v3 protocol introduced in PostgreSQL 7.4
115 * [pg_transaction_status](http://php.net/pg_transaction_status)() - in-transaction status of a database connection
116 * [pg_query_params](http://php.net/pg_query_params)() - execution of parameterized queries
117 * [pg_prepare](http://php.net/pg_prepare)() - prepare named queries
118 * [pg_execute](http://php.net/pg_execute)() - execution of named prepared queries
119 * [pg_send_query_params](http://php.net/pg_send_query_params)() - async equivalent of [pg_query_params](http://php.net/pg_query_params)()
120 * [pg_send_prepare](http://php.net/pg_send_prepare)() - async equivalent of [pg_prepare](http://php.net/pg_prepare)()
121 * [pg_send_execute](http://php.net/pg_send_execute)() - async equivalent of [pg_execute](http://php.net/pg_execute)()
122 * [pg_result_error_field](http://php.net/pg_result_error_field)() - highly detailed error information, most importantly the SQLSTATE error code
123 * [pg_set_error_verbosity](http://php.net/pg_set_error_verbosity)() - set verbosity of errors
124 * Added optional fifth parameter "count" to [preg_replace_callback](http://php.net/preg_replace_callback)() and [preg_replace](http://php.net/preg_replace)() to count the number of replacements made. FR [#32275](http://bugs.php.net/32275)
125 * Added optional third parameter "charlist" to [str_word_count](http://php.net/str_word_count)() which contains characters to be considered as word part. FR [#31560](http://bugs.php.net/31560)
126 * Added interface Serializeable
127 * Added [pg_field_type_oid](http://php.net/pg_field_type_oid)() PostgreSQL function
128 * Added zend_declare_property_...() and zend_update_property_...() API functions for bool, double and binary safe strings
129 * Added possibility to access INI variables from within .ini file
130 * Added variable $_SERVER['REQUEST_TIME'] containing request start time
131 * Added optional float parameter to [gettimeofday](http://php.net/gettimeofday)()
132 * Added [apache_reset_timeout](http://php.net/apache_reset_timeout)() Apache1 function
133 * Added [sqlite_fetch_column_types](http://php.net/sqlite_fetch_column_types)() 3rd argument for arrays
134 * Added optional offset parameter to [stream_get_contents](http://php.net/stream_get_contents)() and [file_get_contents](http://php.net/file_get_contents)()
135 * Added optional maxlen parameter to [file_get_contents](http://php.net/file_get_contents)()
136 * Added SAPI hook to get the current request time
137 * Added new functions:
138 * [array_diff_key](http://php.net/array_diff_key)()
139 * [array_diff_ukey](http://php.net/array_diff_ukey)()
140 * [array_intersect_key](http://php.net/array_intersect_key)()
141 * [array_intersect_ukey](http://php.net/array_intersect_ukey)()
142 * [array_product](http://php.net/array_product)()
143 * DomDocumentFragment::[appendXML](http://php.net/appendXML)()
144 * [fputcsv](http://php.net/fputcsv)()
145 * [htmlspecialchars_decode](http://php.net/htmlspecialchars_decode)()
146 * [inet_pton](http://php.net/inet_pton)()
147 * [inet_ntop](http://php.net/inet_ntop)()
148 * mysqli::client_info property
149 * [posix_access](http://php.net/posix_access)()
150 * [posix_mknod](http://php.net/posix_mknod)()
151 * SimpleXMLElement::XPathNamespace()
152 * [stream_context_get_default](http://php.net/stream_context_get_default)()
153 * [stream_socket_enable_crypto](http://php.net/stream_socket_enable_crypto)()
154 * [stream_wrapper_unregister](http://php.net/stream_wrapper_unregister)()
155 * [stream_wrapper_restore](http://php.net/stream_wrapper_restore)()
156 * [stream_filter_remove](http://php.net/stream_filter_remove)()
157 * [time_sleep_until](http://php.net/time_sleep_until)()
158 * Added DomDocument::$recover property for parsing not well-formed XML Documents
159 * Added Cursor support for MySQL 5.0.x in mysqli
160 * Added proxy support to ftp wrapper via http
161 * Added MDTM support to ftp_url_stat
162 * Added zlib stream filter support
163 * Added bz2 stream filter support
164 * Added max_redirects context option that specifies how many HTTP redirects to follow
165 * Added support of parameter=>value arrays to [xsl_xsltprocessor_set_parameter](http://php.net/xsl_xsltprocessor_set_parameter)()