From: Nikita Popov Date: Tue, 19 Jan 2021 08:59:26 +0000 (+0100) Subject: Disable opcache optimizations during some observer tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd7d829896d6efaf35e001c0a57db20cfcc42be3;p=php Disable opcache optimizations during some observer tests Opcache inlines functions that only return a constant. Disable optimizations to prevent differences in tests where such functions are used (or rewrite the test to not depend on it). --- diff --git a/ext/zend_test/tests/observer_retval_01.phpt b/ext/zend_test/tests/observer_retval_01.phpt index d58cac807d..844d9037f3 100644 --- a/ext/zend_test/tests/observer_retval_01.phpt +++ b/ext/zend_test/tests/observer_retval_01.phpt @@ -6,6 +6,7 @@ Observer: Retvals are observable that are: IS_CONST zend_test.observer.enabled=1 zend_test.observer.observe_all=1 zend_test.observer.show_return_value=1 +opcache.optimization_level=0 --FILE-- --EXPECTF-- - -Done: 42 + +Done: 40 <{closure}> - + diff --git a/ext/zend_test/tests/observer_shutdown_02.phpt b/ext/zend_test/tests/observer_shutdown_02.phpt index ad6c906585..b666a92e15 100644 --- a/ext/zend_test/tests/observer_shutdown_02.phpt +++ b/ext/zend_test/tests/observer_shutdown_02.phpt @@ -16,33 +16,33 @@ class MyClass } } -function bar() { - return 42; +function bar($arg) { + return $arg; } function foo() { - bar(); - return bar(); + bar(41); + return bar(42); } $mc = new MyClass(); -echo 'Done: ' . bar() . PHP_EOL; +echo 'Done: ' . bar(40) . PHP_EOL; ?> --EXPECTF-- - -Done: 42 + +Done: 40 - +