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 true; 10 } 11} 12stream_wrapper_register('foo', 'FooWrapper'); 13var_dump(fopen('foo://bar', 'r')); 14?> 15--EXPECTF-- 16resource(%d) of type (stream) 17