xref: /PHP-8.2/Zend/tests/bug67436/bug67436.phpt (revision 7aacc705)
1--TEST--
2bug67436: Autoloader isn't called if user defined error handler is present
3--INI--
4error_reporting=-1
5--SKIPIF--
6<?php if (extension_loaded('Zend OPCache')) die('skip Opcache overrides error handler'); ?>
7--FILE--
8<?php
9
10spl_autoload_register(function($classname) {
11    if (in_array($classname, array('a','b','c'))) {
12        require_once __DIR__ . "/{$classname}.inc";
13    }
14});
15
16set_error_handler(function ($errno, $errstr, $errfile, $errline) {
17    var_dump($errstr);
18}, error_reporting());
19
20a::staticTest();
21
22$b = new b();
23$b->test();
24?>
25--EXPECTF--
26string(%d) "The magic method b::__invoke() must have public visibility"
27b::test()
28a::test(c::TESTCONSTANT)
29