1--TEST-- 2Inheritance of union type from internal class 3--EXTENSIONS-- 4zend_test 5--FILE-- 6<?php 7 8class C extends _ZendTestClass {} 9 10$obj = new _ZendTestChildClass; 11$obj->classUnionProp = new stdClass; 12$obj->classUnionProp = new ArrayIterator; 13try { 14 $obj->classUnionProp = new DateTime; 15} catch (TypeError $e) { 16 echo $e->getMessage(), "\n"; 17} 18 19$obj = new C; 20$obj->classUnionProp = new stdClass; 21$obj->classUnionProp = new ArrayIterator; 22try { 23 $obj->classUnionProp = new DateTime; 24} catch (TypeError $e) { 25 echo $e->getMessage(), "\n"; 26} 27 28?> 29--EXPECT-- 30Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null 31Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null 32