2005-11-23 23:01:54 +08:00
|
|
|
$Id$
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
UPGRADE NOTES - PHP X.Y
|
|
|
|
|
|
|
|
1. Changes made to default configuration
|
|
|
|
2. Reserved words and classes
|
2011-01-01 00:57:45 +08:00
|
|
|
3. Changes made to engine behaviour
|
|
|
|
4. Changes made to existing functions
|
|
|
|
5. Changes made to existing methods
|
|
|
|
6. Changes made to existing classes
|
|
|
|
7. Deprecated
|
|
|
|
8. Removed
|
|
|
|
9. Extensions:
|
2009-01-29 01:23:28 +08:00
|
|
|
a. moved out to PECL and actively maintained there
|
|
|
|
b. no longer maintained
|
|
|
|
c. with changed behaviour
|
|
|
|
d. no longer possible to disable
|
2011-01-01 00:57:45 +08:00
|
|
|
10. Changes in SAPI support
|
|
|
|
11. Changes in INI directives
|
2010-12-10 15:59:34 +08:00
|
|
|
12. Syntax additions
|
|
|
|
13. Windows support
|
|
|
|
14. New in PHP X.Y:
|
2009-01-29 01:23:28 +08:00
|
|
|
a. New libraries
|
|
|
|
b. New extensions
|
|
|
|
c. New stream wrappers
|
2009-06-25 05:16:53 +08:00
|
|
|
d. New stream filters
|
|
|
|
e. New functions
|
|
|
|
f. New global constants
|
|
|
|
g. New classes
|
|
|
|
h. New methods
|
|
|
|
i. New class constants
|
2010-03-25 00:23:50 +08:00
|
|
|
j. New hash algorithms
|
2011-07-24 04:27:08 +08:00
|
|
|
k. New Syntax
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
========================================
|
|
|
|
1. Changes made to default configuration
|
|
|
|
========================================
|
2009-06-25 05:16:53 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
- The default_charset setting now defaults to UTF-8.
|
|
|
|
It was ISO-88590-1 before, so if you were relying
|
|
|
|
on the default, you will need to add:
|
2009-06-15 03:15:57 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
default_charset = iso-8859-1
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-04-01 02:03:17 +08:00
|
|
|
to your php.ini to preserve pre-PHPX.Y behavior.
|
|
|
|
|
|
|
|
- We now check at compile time if /dev/urandom or /dev/arandom
|
|
|
|
are present to provide non-blocking entropy to session id
|
|
|
|
generation. If either is present, session.entropy_file
|
|
|
|
now defaults to that file and session.entropy_length defaults
|
|
|
|
to 32. If you do not want extra entropy for your session ids
|
|
|
|
for some reason, add:
|
|
|
|
|
|
|
|
session.entropy_file=
|
|
|
|
session.entropy_length=0
|
|
|
|
|
|
|
|
to your php.ini to preserve pre-PHPX.Y behavior.
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-04-29 09:03:21 +08:00
|
|
|
- Deprecated ini directives will now throw an E_CORE_WARNING's
|
|
|
|
instead of the previous E_WARNING's.
|
|
|
|
|
|
|
|
The following directives are marked as deprecated:
|
|
|
|
- magic_quotes_gpc
|
|
|
|
- magic_quotes_runtime
|
|
|
|
- magic_quotes_sybase
|
|
|
|
|
|
|
|
- The following directives, which indicates a removed feature
|
|
|
|
in PHP will now throw an E_CORE_ERROR upon startup like the
|
|
|
|
deprecation warnings.
|
|
|
|
|
|
|
|
The following directives are no longer available:
|
|
|
|
- allow_call_time_pass_reference
|
|
|
|
- define_syslog_variables
|
|
|
|
- highlight.bg
|
|
|
|
- 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
|
|
|
|
- zend.ze1_compatibility_mode
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
=============================
|
|
|
|
2. Reserved words and classes
|
|
|
|
=============================
|
2009-06-25 15:57:05 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2009-06-25 15:57:05 +08:00
|
|
|
|
2011-01-01 00:57:45 +08:00
|
|
|
=============================
|
|
|
|
3. Changes made to engine behaviour
|
|
|
|
=============================
|
|
|
|
|
|
|
|
- Turning null, false or empty string into an object by adding a property
|
|
|
|
will now emit a warning instead of an E_STRICT error.
|
|
|
|
|
|
|
|
$test = null;
|
|
|
|
$test->baz = 1;
|
|
|
|
|
|
|
|
To create a generic object you can use StdClass:
|
|
|
|
$test = new StdClass;
|
2011-08-09 23:27:25 +08:00
|
|
|
$test->baz = 1;
|
2011-08-06 23:57:36 +08:00
|
|
|
|
|
|
|
- It's now possible to enforce the class' __construct arguments in an abstract
|
|
|
|
constructor in the base class.
|
|
|
|
|
|
|
|
abstract class Base
|
|
|
|
{
|
|
|
|
abstract public function __construct();
|
|
|
|
}
|
|
|
|
class Foo extends Base
|
|
|
|
{
|
|
|
|
public function __construct($bar) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
Now emits a Fatal error due the incompatible declaration.
|
2011-01-01 00:57:45 +08:00
|
|
|
|
2011-09-07 23:28:12 +08:00
|
|
|
- In previous versions, names of superglobals could be used for parameter
|
|
|
|
names, thereby shadowing the corresponding superglobal. This now causes a
|
|
|
|
fatal error such as "Cannot re-assign auto-global variable GLOBALS".
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
=====================================
|
2011-01-01 00:57:45 +08:00
|
|
|
4. Changes made to existing functions
|
2010-03-25 00:23:50 +08:00
|
|
|
=====================================
|
2009-06-26 02:01:08 +08:00
|
|
|
|
2010-08-27 11:54:10 +08:00
|
|
|
- array_combine now returns array() instead of FALSE when two empty arrays are
|
|
|
|
provided as parameters.
|
2010-10-25 00:21:15 +08:00
|
|
|
- Added an extra parameter to dns_get_record(), which allows requesting DNS
|
|
|
|
records by numeric type and makes the result include only the raw data of
|
|
|
|
the response.
|
|
|
|
- call_user_func_array no longer allows call-time pass by reference.
|
|
|
|
- htmlentities/htmlspecialchars are stricter in the code units they accept for
|
|
|
|
the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are rejected.
|
|
|
|
For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are rejected. For
|
|
|
|
SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected, except maybe
|
|
|
|
after a valid starting byte. For EUC-JP, the octets 0xA0 and 0xFF are
|
|
|
|
rejected.
|
|
|
|
- htmlentities now emits an E_STRICT warning when used with asian characters,
|
|
|
|
as in that case htmlentities has (and already had before this version) the
|
|
|
|
same functionality as htmlspecialchars.
|
|
|
|
- htmlentities no longer numerically encodes high characters for single-byte
|
|
|
|
encodings (except when there's actually a corresponding named entity). This
|
|
|
|
behavior was not documented and was inconsistent with that for "UTF-8".
|
|
|
|
- html_entity_decode/htmlspecialchars_decode behave more consistently, now
|
|
|
|
decoding entities in malformed strings such as "&&" or "&#&".
|
|
|
|
- htmlentities/htmlspecialchars/html_entity_decode/htmlspecialchars_decode:
|
|
|
|
Added the flags ENT_HTML401, ENT_XML1, ENT_XHTML, and ENT_HTML5. The
|
|
|
|
behavior of these functions including, but not limited to, the characters
|
|
|
|
that are encoded and the entities that are decoded depend on the document
|
|
|
|
type that is specified by those flags.
|
|
|
|
- htmlentities/htmlspecialchars with !$double_encode do more strict checks on
|
|
|
|
the validity of the entities. Numerical entities are checked for a valid
|
|
|
|
range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the validity of
|
|
|
|
such numerical entity in the target document type is also checked. Named
|
2011-01-20 06:41:01 +08:00
|
|
|
entities are checked for necessary existence in the target document type
|
2010-10-25 00:21:15 +08:00
|
|
|
instead of only checking whether they were constituted by alphanumeric
|
|
|
|
characters.
|
2011-01-20 06:41:01 +08:00
|
|
|
- The flag ENT_DISALLOWED was added. In addition to the behavior described in
|
2010-10-25 00:21:15 +08:00
|
|
|
the item before, it also makes htmlentities/htmlspecialchars substitute
|
|
|
|
characters that appear literally in the argument string and which are not
|
|
|
|
allowed in the target document type with U+FFFD (UTF-8) or �.
|
|
|
|
- The flag ENT_SUBSTITUTE was added. This flag makes invalid multibyte
|
|
|
|
sequences be replaced by U+FFFD (UTF-8) or &#FFFD; by htmlspecialchars and
|
|
|
|
htmlentities. It is an alternative to the default behavior, which just
|
|
|
|
returns an empty string and to ENT_IGNORE, which is a security risk. The
|
|
|
|
behavior follows the recommendations of Unicode Technical Report #36.
|
|
|
|
- htmlspecialchars_decode/html_entity_decode now decode ' if the document
|
|
|
|
type is ENT_XML1, ENT_XHTML, or ENT_HTML5.
|
2011-01-25 18:57:07 +08:00
|
|
|
- Charset detection with $charset == '' no longer turns to mbstring's
|
|
|
|
internal encoding defined through mb_internal_encoding(). Only the encoding
|
|
|
|
defined through the ini setting mbstring.internal_encoding is considered.
|
2010-12-03 18:10:08 +08:00
|
|
|
- number_format() no longer truncates multibyte decimal points and thousand
|
|
|
|
separators to the first byte.
|
2010-11-05 12:37:27 +08:00
|
|
|
- The third parameter ($matches) to preg_match_all() is now optional. If
|
|
|
|
omitted, the function will simply return the number of times the pattern was
|
|
|
|
matched in the subject and will have no other side effects.
|
2010-11-26 17:52:28 +08:00
|
|
|
- The second argument of scandir() now accepts SCANDIR_SORT_NONE (2) as a
|
|
|
|
possible value. This value results in scandir() performing no sorting: on
|
|
|
|
local filesystems, this allows files to be returned in native filesystem
|
|
|
|
order.
|
2010-12-01 00:22:48 +08:00
|
|
|
- stream_select() now preserves the keys of the passed array, be they numeric or
|
|
|
|
strings. This breaks code that iterated the resulting stream array using a
|
|
|
|
numeric index, but makes easier to identify which of the passed streams are
|
|
|
|
present in the result.
|
2011-02-19 09:28:37 +08:00
|
|
|
- stream_set_write_buffer() no longer disables the read buffer of a plain
|
|
|
|
stream when 0 is given as the second argument.
|
|
|
|
- stream_set_write_buffer() no longer changes the chunk size in socket streams.
|
2011-03-21 10:58:54 +08:00
|
|
|
- fclose() closes streams with resource refcount > 1; it doesn't merely
|
|
|
|
decrement the resource refcount.
|
2011-04-06 18:17:52 +08:00
|
|
|
- socket_set_options() and socket_get_options() now support multicast options.
|
2011-05-18 12:43:21 +08:00
|
|
|
- Arrays cast from SimpleXMLElement now always contain all nodes instead of
|
|
|
|
just the first matching node.
|
|
|
|
- All SimpleXMLElement children are now always printed when using var_dump(),
|
|
|
|
var_export(), and print_r().
|
2011-05-21 02:56:13 +08:00
|
|
|
- The raw data parameter in openssl_encrypt()/openssl_decrypt() is now an options
|
|
|
|
integer rather than a boolean. A value of true produces the same behaviour.
|
2011-07-12 12:58:38 +08:00
|
|
|
- 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)
|
2009-06-26 02:01:08 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
===================================
|
2011-01-01 00:57:45 +08:00
|
|
|
5. Changes made to existing methods
|
2009-01-29 01:23:28 +08:00
|
|
|
===================================
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
===================================
|
2011-01-01 00:57:45 +08:00
|
|
|
6. Changes made to existing classes
|
2009-01-29 01:23:28 +08:00
|
|
|
===================================
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2011-02-17 08:25:32 +08:00
|
|
|
- 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.
|
2011-03-28 06:44:34 +08:00
|
|
|
- Constructors of userspace subclasses of the following SPL classes are now
|
|
|
|
required to call the parent constructor and not clear any exceptions they
|
|
|
|
throw (replacing the thrown exception by another one is permitted):
|
|
|
|
SplFileInfo, DirectoryIterator, FilesystemIterator, GlobIterator,
|
|
|
|
SplFileObject, SplTempFileObject, RecursiveDirectoryIterator,
|
|
|
|
IteratorIterator, FilterIterator, RecursiveFilterIterator, ParentIterator,
|
|
|
|
LimitIterator, CachingIterator, RecursiveCachingIterator, NoRewindIterator,
|
|
|
|
AppendIterator, InfiniteIterator, RegexIterator, RecursiveRegexIterator, and
|
|
|
|
RecursiveTreeIterator.
|
|
|
|
It is no longer possible to defer the parent constructor call until after the
|
|
|
|
object is constructed.
|
|
|
|
|
2005-11-23 07:49:13 +08:00
|
|
|
|
|
|
|
=============
|
2011-01-01 00:57:45 +08:00
|
|
|
7. Deprecated
|
2005-11-23 07:49:13 +08:00
|
|
|
=============
|
|
|
|
|
2010-04-29 09:03:21 +08:00
|
|
|
==========
|
2011-01-01 00:57:45 +08:00
|
|
|
8. Removed
|
2010-04-29 09:03:21 +08:00
|
|
|
==========
|
|
|
|
|
|
|
|
a. removed features
|
|
|
|
|
2011-07-24 04:45:18 +08:00
|
|
|
- magic quotes
|
|
|
|
. remove magic_quotes_gpc, magic_quotes_runtime,
|
|
|
|
magic_quotes_sybase (calling ini_set('magic_....')
|
|
|
|
returns 0|false
|
|
|
|
. get_magic_quotes_gpc, get_magic_quotes_runtime are kept but
|
|
|
|
always return false
|
|
|
|
. set_magic_quotes_runtime raises an E_CORE_ERROR
|
|
|
|
|
2010-04-29 09:03:21 +08:00
|
|
|
- register_globals
|
|
|
|
- register_long_arrays
|
|
|
|
- Safe mode
|
|
|
|
- Session extension bug compatibility mode
|
|
|
|
- y2k_compliance mode
|
|
|
|
|
|
|
|
b. removed ini directives
|
|
|
|
|
|
|
|
- define_syslog_variables
|
|
|
|
- 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_compat42
|
|
|
|
- session.bug_compat_warn
|
|
|
|
- y2k_compliance
|
|
|
|
|
|
|
|
c. removed functions
|
|
|
|
|
|
|
|
- define_syslog_variables()
|
|
|
|
- import_request_variables()
|
|
|
|
- session_is_registered()
|
|
|
|
- session_register()
|
|
|
|
- session_unregister()
|
2010-07-07 20:09:36 +08:00
|
|
|
- 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)
|
2010-04-29 09:03:21 +08:00
|
|
|
|
2010-11-25 00:26:49 +08:00
|
|
|
d. removed syntax
|
|
|
|
|
|
|
|
- break $var;
|
|
|
|
- continue $var;
|
|
|
|
|
2010-04-29 09:03:21 +08:00
|
|
|
=============
|
2011-01-01 00:57:45 +08:00
|
|
|
9. Extensions
|
2010-04-29 09:03:21 +08:00
|
|
|
=============
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
a. moved out to PECL and actively maintained there
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
b. no longer maintained
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-11-20 01:22:05 +08:00
|
|
|
- ext/sqlite
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
c. with changed behaviour
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2011-09-07 21:33:56 +08:00
|
|
|
- The MySQL extensions (ext/mysql, mysqli and PDO_mysql) use mysqlnd
|
|
|
|
as defalt library now. It is still possible to use libmysql by
|
|
|
|
specifying a path to the configure options.
|
2010-05-12 00:40:03 +08:00
|
|
|
- The session extension now can hook into the file upload feature
|
|
|
|
in order to provide upload progress information through session
|
|
|
|
variables.
|
2011-03-27 17:44:38 +08:00
|
|
|
- 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 behaviour 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.
|
2011-07-18 01:18:31 +08:00
|
|
|
- Function snmp_set_valueretrieval() changed it's behaviour:
|
|
|
|
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.
|
2011-03-27 17:44:38 +08:00
|
|
|
- Added feature-rich OO API (SNMP class)
|
2011-04-05 20:20:35 +08:00
|
|
|
- Dropped UCD-SNMP compatibility code. Consider upgrading to
|
|
|
|
net-snmp v5.3+. Net-SNMP v5.4+ is required for Windows version.
|
2011-08-21 04:56:02 +08:00
|
|
|
- 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.
|
2011-03-27 17:44:38 +08:00
|
|
|
|
2009-06-26 02:17:52 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
d. no longer possible to disable
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
==========================
|
2011-01-01 00:57:45 +08:00
|
|
|
10. Changes in SAPI support
|
2009-01-29 01:23:28 +08:00
|
|
|
==========================
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-11-17 22:08:39 +08:00
|
|
|
- The REQUEST_TIME value inside server now returns a floating point number
|
|
|
|
indicating the time with microsecond precision. All SAPIs providing this
|
2010-11-08 03:27:08 +08:00
|
|
|
value should be returning float and not time_t.
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-04-29 09:03:21 +08:00
|
|
|
=============================
|
2011-01-01 00:57:45 +08:00
|
|
|
11. Changes in INI directives
|
2010-04-29 09:03:21 +08:00
|
|
|
=============================
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-05-12 00:40:03 +08:00
|
|
|
- Added 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.
|
2010-11-24 13:41:23 +08:00
|
|
|
- Added zend.multibyte directive as a replacement of PHP compile time
|
|
|
|
configuration option --enable-zend-multibyte. Now ZE always contains code for
|
|
|
|
multibyte support, but may enable or disable it by zend.multibyte. It doesn't
|
|
|
|
make a lot of sense to enable this option without ext/mbstring, because the
|
|
|
|
most functionality is implemented by mbstrings callbacks.
|
2011-08-09 23:27:25 +08:00
|
|
|
- Added enable_post_data_reading, which is enabled by default. When it's
|
2010-12-10 15:59:34 +08:00
|
|
|
disabled, the POST data is not read (and 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 read/process the POST data in a
|
|
|
|
stream fashion (through php://input), without having it copied in memory two/
|
|
|
|
three times.
|
2011-07-24 13:42:29 +08:00
|
|
|
- Changed E_ALL to include E_STRICT. Recommended production value changed to
|
|
|
|
E_ALL & ~E_DEPRECATED & ~E_STRICT.
|
2009-06-27 21:23:03 +08:00
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
====================
|
2011-01-01 00:57:45 +08:00
|
|
|
12. Syntax additions
|
2009-01-29 01:23:28 +08:00
|
|
|
====================
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-06-08 08:05:29 +08:00
|
|
|
- Array dereferencing.
|
|
|
|
e.g.
|
|
|
|
foo()[0]
|
|
|
|
$foo->bar()[0]
|
2009-06-25 15:57:05 +08:00
|
|
|
|
2011-08-16 18:44:47 +08:00
|
|
|
- Callable typehint, argument must be callable (i.e. pass is_callable($arg, false))
|
|
|
|
example:
|
|
|
|
function foo(callable $do) {
|
|
|
|
}
|
|
|
|
foo("strcmp");
|
|
|
|
foo(function() {});
|
|
|
|
$o = new ArrayObject();
|
|
|
|
foo(array($o, "count"));
|
|
|
|
|
2009-01-29 01:23:28 +08:00
|
|
|
===================
|
2011-01-01 00:57:45 +08:00
|
|
|
13. Windows support
|
2009-01-29 01:23:28 +08:00
|
|
|
===================
|
|
|
|
|
2010-09-01 18:23:58 +08:00
|
|
|
- is_link now works properly for symbolic links on Windows Vista
|
|
|
|
or later. Earlier systems do not support symbolic links.
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
|
|
===================
|
2011-01-01 00:57:45 +08:00
|
|
|
14. New in PHP X.Y:
|
2009-01-29 01:23:28 +08:00
|
|
|
===================
|
|
|
|
|
|
|
|
a. New libraries
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
|
|
b. New extensions
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
|
|
c. New stream wrappers
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2009-06-24 03:40:31 +08:00
|
|
|
d. New stream filters
|
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
-
|
2009-06-24 03:40:31 +08:00
|
|
|
|
|
|
|
e. New functions
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
- Core:
|
2010-08-09 21:27:13 +08:00
|
|
|
- get_declared_traits()
|
2011-06-03 08:12:22 +08:00
|
|
|
- hex2bin()
|
2010-08-09 21:27:13 +08:00
|
|
|
- http_response_code()
|
2011-02-19 09:28:37 +08:00
|
|
|
- stream_set_chunk_size()
|
2011-03-23 08:51:22 +08:00
|
|
|
- socket_import_stream()
|
2011-06-03 08:12:22 +08:00
|
|
|
- trait_exists()
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2011-05-20 06:49:47 +08:00
|
|
|
- LDAP:
|
|
|
|
- ldap_control_paged_results()
|
|
|
|
- ldap_control_paged_results_response()
|
|
|
|
|
2011-08-29 13:00:26 +08:00
|
|
|
- libxml
|
|
|
|
- libxml_set_external_entity_loader()
|
|
|
|
|
2009-06-24 03:40:31 +08:00
|
|
|
f. New global constants
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2010-09-17 00:21:15 +08:00
|
|
|
- JSON_PRETTY_PRINT
|
2010-09-16 21:53:27 +08:00
|
|
|
- JSON_UNESCAPED_SLASHES
|
2010-10-25 00:21:15 +08:00
|
|
|
- ENT_SUBSTITUTE
|
|
|
|
- ENT_ALLOWED
|
|
|
|
- ENT_HTML401
|
|
|
|
- ENT_XML1
|
|
|
|
- ENT_XHTML
|
|
|
|
- ENT_HTML5
|
2010-11-26 17:52:28 +08:00
|
|
|
- SCANDIR_SORT_ASCENDING
|
|
|
|
- SCANDIR_SORT_DESCENDING
|
|
|
|
- SCANDIR_SORT_NONE
|
2011-04-06 18:17:52 +08:00
|
|
|
- MCAST_JOIN_GROUP
|
|
|
|
- MCAST_LEAVE_GROUP
|
|
|
|
- MCAST_BLOCK_SOURCE
|
|
|
|
- MCAST_UNBLOCK_SOURCE
|
|
|
|
- MCAST_JOIN_SOURCE_GROUP
|
|
|
|
- MCAST_LEAVE_SOURCE_GROUP
|
|
|
|
- IP_MULTICAST_IF
|
|
|
|
- IP_MULTICAST_TTL
|
|
|
|
- IP_MULTICAST_LOOP
|
|
|
|
- IPV6_MULTICAST_IF
|
|
|
|
- IPV6_MULTICAST_HOPS
|
|
|
|
- IPV6_MULTICAST_LOOP
|
|
|
|
- IPPROTO_IP
|
|
|
|
- IPPROTO_IPV6
|
2011-05-21 02:56:13 +08:00
|
|
|
- OPENSSL_RAW_DATA
|
|
|
|
- OPENSSL_ZERO_PADDING
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2009-06-24 03:40:31 +08:00
|
|
|
g. New classes
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2010-06-03 20:46:14 +08:00
|
|
|
- Reflection:
|
|
|
|
- ReflectionZendExtension
|
2010-10-25 00:21:15 +08:00
|
|
|
|
|
|
|
- Intl:
|
|
|
|
- Transliterator
|
2011-03-27 17:44:38 +08:00
|
|
|
|
|
|
|
- SNMP:
|
|
|
|
- SNMP
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2011-03-28 04:24:40 +08:00
|
|
|
- SPL:
|
|
|
|
- CallbackFilterIterator
|
|
|
|
- RecursiveCallbackFilterIterator
|
|
|
|
|
2009-06-24 03:40:31 +08:00
|
|
|
h. New methods
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2010-12-24 06:32:52 +08:00
|
|
|
- DirectoryIterator
|
|
|
|
- DirectoryIterator::getExtension()
|
|
|
|
|
2010-06-02 23:29:42 +08:00
|
|
|
- Reflection:
|
|
|
|
- ReflectionClass::isCloneable()
|
2010-06-03 20:31:22 +08:00
|
|
|
- ReflectionClass::getTraits()
|
|
|
|
- ReflectionClass::getTraitNames()
|
|
|
|
- ReflectionClass::getTraitAliases()
|
2010-10-26 23:01:36 +08:00
|
|
|
- ReflectionParameter::canBePassedByValue()
|
2011-08-16 18:44:47 +08:00
|
|
|
- ReflectionParameter::isCallable()
|
2010-09-17 05:49:48 +08:00
|
|
|
|
2011-01-06 10:32:02 +08:00
|
|
|
- RegexIterator
|
|
|
|
- RegexIterator::getRegex()
|
|
|
|
|
2010-09-17 05:49:48 +08:00
|
|
|
- PDO_dblib
|
|
|
|
- PDO::newRowset()
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2010-12-24 06:32:52 +08:00
|
|
|
- SplFileInfo
|
|
|
|
- SplFileInfo::getExtension()
|
|
|
|
|
2010-11-09 23:07:50 +08:00
|
|
|
- SplFileObject
|
|
|
|
- SplFileObject::fputcsv()
|
|
|
|
|
2009-06-24 03:40:31 +08:00
|
|
|
i. New class constants
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2011-01-29 13:26:45 +08:00
|
|
|
-
|
2010-03-25 00:23:50 +08:00
|
|
|
|
|
|
|
j. New Hash algorithms
|
|
|
|
|
|
|
|
- fnv132
|
|
|
|
- fnv164
|
|
|
|
- joaat
|
2011-07-24 04:23:21 +08:00
|
|
|
|
|
|
|
k. New Syntax
|
2011-07-24 04:27:08 +08:00
|
|
|
- Short array syntax in 5.4.0
|
2011-07-24 04:23:21 +08:00
|
|
|
$a = [1, 2, 3, 4];
|
|
|
|
$a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];
|
|
|
|
$a = ['one' => 1, 2, 'three' => 3, 4];
|
2010-08-30 17:38:47 +08:00
|
|
|
|
2011-07-27 08:18:35 +08:00
|
|
|
- Binary number format
|
|
|
|
0b00100 0b010101
|