diff options
author | Stanislav Malyshev <stas@php.net> | 2012-05-24 14:17:07 -0500 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2012-05-24 14:18:12 -0500 |
commit | b187c35f236edd7370d63f02c26d5272997830ee (patch) | |
tree | b245b33cff41854d063a54fefb4bba3d74c4beb9 /UPGRADING | |
parent | 3bd0a52468b6776d87ac8a41c6a9be5101db2752 (diff) | |
parent | ec061a93c53c8cde10237741e98e992c1a05d148 (diff) | |
download | php-git-b187c35f236edd7370d63f02c26d5272997830ee.tar.gz |
Merge branch 'pull-request/54'
* pull-request/54:
Allow arbitrary expressions for empty()
This change is as per RFC https://wiki.php.net/rfc/empty_isset_exprs.
The change allows passing the result of function calls and other
expressions to the empty() language construct. This is accomplished by
simply rewriting empty(expr) to !expr.
The change does not affect the suppression of errors when using empty()
on variables. empty($undefinedVar) will continue not to throw errors.
When an expression is used inside empty() on the other hand, errors will
not be suppressed. Thus empty($undefinedVar + $somethingElse) *will*
throw a notice.
The change also does not make empty() into a real function, so using
'empty' as a callback is still not possible.
In addition to the empty() changes the commit adds nicer error messages
when isset() is used on function call results or other expressions.
Diffstat (limited to 'UPGRADING')
-rwxr-xr-x | UPGRADING | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -28,6 +28,9 @@ PHP X.Y UPGRADE NOTES - Support constant array/string dereferencing. (Laruence) (https://wiki.php.net/rfc/constdereference) +- Add support for using empty() on the result of function calls and + other expressions. Thus it is now possible to write empty(getArray()), + for example. (https://wiki.php.net/rfc/empty_isset_exprs) ======================================== 2. Changes in SAPI modules @@ -51,7 +54,7 @@ PHP X.Y UPGRADE NOTES - Implemented format character "Z": NUL-padded string - "a" now does not remove trailing NUL characters on unpack() anymore - "A" will now strip all trailing ASCII whitespace on unpack() (it used to - remove only trailing spaces. + remove only trailing spaces). - MessageFormatter::format() and related functions now accepted named arguments and mixed numeric/named arguments in ICU 4.8+. - MessageFormatter::format() and related functions now don't error out when |