summaryrefslogtreecommitdiff
path: root/src/tests/disable_function/disabled_function_echo_2.phpt (follow)
AgeCommit message (Collapse)Author
22 hoursPrevent opcache from inlining functions with return-value rules on PHP 8.5+HEADmasterjvoisin
PHP 8.5's opcache optimizer can inline trivial user functions (constant return values), completely eliminating the DO_UCALL opcode. When this happens, zend_execute_ex is never invoked and snuffleupagus's return-value monitoring hooks never fire. Fix this by setting ZEND_ACC_HAS_TYPE_HINTS on monitored functions' op_arrays during compilation (via sp_op_array_handler). This flag is checked by opcache's zend_try_inline_call() and prevents inlining. For 0-arg functions — the only ones eligible for inlining — there are no RECV opcodes, so the runtime impact is zero. To enable sp_op_array_handler when return-value rules are configured, the extension now registers itself as a zend extension and sets ZEND_COMPILE_HANDLE_OP_ARRAY (previously only done for global_strict). The disabled_function_echo_2 test is updated to use separate echo statements and opcache.optimization_level=0, since opcache's echo merging is a compile-time string concatenation that cannot be prevented per-function. This is a bit ugly, but it's the less awful solution to be able to hook return values.
2023-01-04Fix the CI for PHP8.2jvoisin
2020-12-25mark some tests as passing on php8jvoisin
2020-12-12Mark the relevant php8 tests as broken (#359)jvoisin
* Skip tests broken on php8 * Oops * Fix some tests * Add some XXE tests for php8 * Fix a test
2020-12-01In tests, don't `die("skip")` but `print "skip"` instead (#358)jvoisin
This is required since the `die` is making php8 choke
2020-07-21Fix #338 - added log type if type is simulation, drop or log. (#339)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2019-11-03Log ip addresseskkadosh
2019-01-14Reorganize the testsuitejvoisin
Splitting the testsuite in several components makes it easier to manage and comprehend. This was also needed some some tests aren't passing on Alpine Linux, but we still want to run as many of them as we can on this platform.