xref: /php-src/Zend/tests/gh11735_2.phpt (revision c3ccc363)
1--TEST--
2GH-11735: Use-after-free when unregistering user stream wrapper from user stream wrapper
3--FILE--
4<?php
5class FooWrapper {
6    public $context;
7    public function stream_open($path, $mode, $options, &$opened_path) {
8        stream_wrapper_unregister('foo');
9        return false;
10    }
11}
12stream_wrapper_register('foo', 'FooWrapper');
13var_dump(fopen('foo://bar', 'r'));
14?>
15--EXPECTF--
16Warning: fopen(foo://bar): Failed to open stream: "FooWrapper::stream_open" call failed in %s on line %d
17bool(false)
18