xref: /PHP-8.1/ext/opcache/tests/bug64353.phpt (revision 48981f4f)
1--TEST--
2Bug #64353 (Built-in classes can be unavailable with dynamic includes and OPcache)
3--INI--
4allow_url_include=1
5opcache.enable=1
6opcache.enable_cli=1
7--EXTENSIONS--
8opcache
9--FILE--
10<?php
11class BugLoader extends php_user_filter {
12    public function filter($in, $out, &$consumed, $closing): int {
13        if (!class_exists("Test")) {
14            eval("class Test extends ArrayObject {}");
15        }
16        while ($bucket = stream_bucket_make_writeable($in)) {
17            $consumed += $bucket->datalen;
18            stream_bucket_append($out, $bucket);
19        }
20        return PSFS_PASS_ON;
21    }
22}
23
24stream_filter_register('bug.test', 'BugLoader');
25include "php://filter/read=bug.test/resource=data://text/plain,<?php\n";
26echo "OK\n";
27?>
28--EXPECT--
29Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
30OK
31