1--TEST-- 2Preloading class using trait with undefined class constant access 3--INI-- 4opcache.enable=1 5opcache.enable_cli=1 6opcache.optimization_level=-1 7opcache.preload={PWD}/preload_undef_const_2.inc 8--EXTENSIONS-- 9opcache 10--SKIPIF-- 11<?php 12if (PHP_OS_FAMILY == 'Windows') die('skip Preloading is not supported on Windows'); 13?> 14--FILE-- 15<?php 16var_dump(trait_exists('T')); 17var_dump(class_exists('Foo')); 18try { 19 new Foo(); 20} catch (Throwable $ex) { 21 echo $ex->getMessage() . "\n"; 22} 23?> 24--EXPECT-- 25bool(true) 26bool(true) 27Undefined constant "UNDEF" 28