Skip to content

Fix $x = (bool)$x; with opcache (should emit undeclared variable notice) #4914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

TysonAndre
Copy link
Contributor

And $x = !$x

Noticed while working on GH-4912

The included test would not emit undefined variable errors in php 8.0
with opcache enabled. The command used:

php -d zend_extension=opcache.so --no-php-ini -d error_reporting=E_ALL \
    -d opcache.file_cache= -d opcache.enable_cli=1  test.php

@TysonAndre TysonAndre force-pushed the fix-BOOL_NOT-undef-check branch from 1f82635 to 65157a8 Compare November 15, 2019 18:42
@TysonAndre
Copy link
Contributor Author

If this gets merged from 7.2 into php 8.0, the test expectation should be a warning, not a notice

And `$x = !$x`

Noticed while working on phpGH-4912

The included test would not emit undefined variable errors in php 8.0
with opcache enabled. The command used:

```
php -d zend_extension=opcache.so --no-php-ini -d error_reporting=E_ALL \
    -d opcache.file_cache= -d opcache.enable_cli=1  test.php
```
@TysonAndre TysonAndre force-pushed the fix-BOOL_NOT-undef-check branch from 65157a8 to 75ed894 Compare November 15, 2019 19:06
@TysonAndre TysonAndre changed the title Fix $x = (bool)$x; for undefined with opcache Fix $x = (bool)$x; with opcache (should emit undeclared variable notice) Nov 16, 2019
@cmb69 cmb69 added the Bug label Nov 17, 2019
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks about right to me, but would like to have @dstogov or @nikic to have a look.

@dstogov
Copy link
Member

dstogov commented Nov 18, 2019

Merged as a2c41c0

@dstogov dstogov closed this Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants