1--TEST-- 2User streams and incrrectly typed context 3--FILE-- 4<?php 5class Wrapper { 6 public Foo $context; 7} 8if (stream_wrapper_register('foo', Wrapper::class)) dir('foo://'); 9?> 10--EXPECTF-- 11Fatal error: Uncaught TypeError: Cannot assign resource to property Wrapper::$context of type Foo in %suser_streams_context_001.php:5 12Stack trace: 13#0 %suser_streams_context_001.php(5): dir('foo://') 14#1 {main} 15 thrown in %suser_streams_context_001.php on line 5 16