php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76535 Opcache does not replay compile-time warnings
Submitted: 2018-06-27 09:00 UTC Modified: 2018-06-28 09:39 UTC
From: nikic@php.net Assigned:
Status: Open Package: opcache
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-06-27 09:00 UTC] nikic@php.net
Description:
------------
If opcache is enabled, non-fatal compile-time diagnostics are only emitted on first compile, not when the file is fetched from cache.

It would be nice if we would register an error handler that records all the emitted warnings and then emit them when the file is loaded.

Main motivation is testing: Currently if you want to test a file cache compile&load cycle, you have to filter out many tests that always fail due to warning differences. It's hard to spot regressions because of that.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-28 04:40 UTC] laruence@php.net
on the other hand, warnings should be killed anyway....

so I am not sure if it is worthy to do this...
 [2018-06-28 08:49 UTC] nikic@php.net
@laruence: My main use for this is testing. To test file cache, you need to run something like

    sapi/cli/php run-tests.php -P -c php.ini -d opcache.file_cache=/tmp Zend/
    sapi/cli/php run-tests.php -P -c php.ini -d opcache.file_cache=/tmp -d opcache.validate_timestamps=0 Zend/

However, this causes a lot of test failures even if every thing works "correctly", due to differences in warnings.

Unless by killing warnings you mean that we have plans to remove them from PHP entirely, I think it makes sense to implement this.
 [2018-06-28 09:36 UTC] laruence@php.net
I mean that if there is warning, people(php users) should fix it in there own codes...

anyway, I understand your point, maybe just disable opcache while test warnings?

I was concern that we need pay some costs, like performance reduce to achieve this... like save_cwd...

if it cost little, then I have no problems....
 [2018-06-28 09:39 UTC] nikic@php.net
If there is a performance concern, I'd be fine with having this behind an ini flag like opcache.replay_warnings=1.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 08:01:26 2019 UTC