--TEST-- Test that internal classes can register intersection types --EXTENSIONS-- zend_test spl --FILE-- classIntersectionProp); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->classIntersectionProp = new EmptyIterator(); } catch (TypeError $e) { echo $e->getMessage(), PHP_EOL; } try { $o->classIntersectionProp = new C(); } catch (TypeError $e) { echo $e->getMessage(), PHP_EOL; } $o->classIntersectionProp = new I(); ?> ==DONE== --EXPECT-- Error: Typed property _ZendTestClass::$classIntersectionProp must not be accessed before initialization Cannot assign EmptyIterator to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable Cannot assign C to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable ==DONE==