summaryrefslogtreecommitdiff
path: root/NEWS
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2012-04-12 09:54:52 (GMT)
committerNikita Popov <nikic@php.net>2012-05-13 12:56:51 (GMT)
commitec061a93c53c8cde10237741e98e992c1a05d148 (patch)
tree443c1b193db39a901d5540543bcbaa012ef76c8c /NEWS
parent5852e5f48d7b013108b98b9c57c18383765d21ea (diff)
downloadphp-ec061a93c53c8cde10237741e98e992c1a05d148.tar.gz
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 'NEWS')
-rw-r--r--NEWS3
1 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 42c2f83..87ecf08 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ PHP NEWS
. World domination
. Improve set_exception_handler while doing reset.(Laruence)
. Support constant array/string dereferencing. (Laruence)
+ . Add support for using empty() on the result of function calls and
+ other expressions (https://wiki.php.net/rfc/empty_isset_exprs).
+ (Nikita Popov)
- Core:
. Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).