xref: /PHP-8.3/ext/opcache/tests/gh8063-002.phpt (revision f20e11cb)
1--TEST--
2Bug GH-8063 (Opcache breaks autoloading after E_COMPILE_ERROR) 002
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.record_warnings=1
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11
12spl_autoload_register(function ($class) {
13    printf("Autoloading %s\n", $class);
14    include __DIR__.DIRECTORY_SEPARATOR.'gh8063'.DIRECTORY_SEPARATOR.$class.'.inc';
15});
16
17register_shutdown_function(function () {
18    new Bar();
19    new Baz();
20    print "Finished\n";
21});
22
23new BadClass();
24--EXPECTF--
25Autoloading BadClass
26Autoloading Foo
27
28Fatal error: Declaration of BadClass::dummy() must be compatible with Foo::dummy(): void in %sBadClass.inc on line 5
29Autoloading Bar
30Autoloading Baz
31Finished
32