Skip to content

Allow arbitrary expressions for empty() - #54

Merged
php-pulls merged 1 commit into
php:masterfrom
nikic:emptyExpr
May 24, 2012
Merged

Allow arbitrary expressions for empty()#54
php-pulls merged 1 commit into
php:masterfrom
nikic:emptyExpr

Conversation

@nikic

Copy link
Copy Markdown
Member

@LinusU

Copy link
Copy Markdown
Contributor

I think that this is a great idea, thank you for taking the time to implement it!

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.
@php-pulls
php-pulls merged commit ec061a9 into php:masterMay 24, 2012
@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

merged to master, thanks

1 similar comment
@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

merged to master, thanks

php-pulls pushed a commit that referenced this pull request Mar 15, 2013
* PHP-5.5: (101 commits)
Renamed ZendOptimizerPlus.so into opcache.so
"ZendOptimizerPlus" is renamed to "opcache" to de merged into PHP-5.5 under ext/opcache (the product name is still "Zend Optimizer+")
More accurate restart scheduling
Autogolobal $GLOBALS has to be pinged even if auto_globals_jit=0
Allow only shared O+ build
Fixed typos
add tests into package
Add test script for #57 (segfaults in drupal7)
fixed memory leaks
Fixed Issue #57 (segfaults in drupal7)
Fixed issue #58 (PHP-5.2 compatibility)
Allows exclusion of large files from being cached
Add maintainers inot package.xml
fix ANSI C90 compat
Fixed test
Fixed uninitialized variable
Fixed bug #64353 (Built-in classes can be unavailable with dynamic includes and Optimizer+)
Save a stat() call by calling sapi_module.get_stat()
Fixed#54 (PECL install adds extension= instead of zend_extension= to php.ini)
release 7.0.0
...
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@nikic@LinusU@php-pulls