1--TEST-- 2Throwings NEWs should not be DCEd 3--INI-- 4opcache.enable_cli=1 5opcache.optimization_level=-1 6--EXTENSIONS-- 7opcache 8--FILE-- 9<?php 10 11abstract class Foo {} 12interface Bar {} 13trait Baz {} 14 15class Abc { 16 const BAR = Abc::BAR; 17} 18 19function test1() { 20 $x = new Foo; 21} 22function test2() { 23 $x = new Bar; 24} 25function test3() { 26 $x = new Baz; 27} 28function test4() { 29 $x = new Abc; 30} 31 32try { test1(); } catch (Error $e) { echo $e->getMessage(), "\n"; } 33try { test2(); } catch (Error $e) { echo $e->getMessage(), "\n"; } 34try { test3(); } catch (Error $e) { echo $e->getMessage(), "\n"; } 35try { test4(); } catch (Error $e) { echo $e->getMessage(), "\n"; } 36 37?> 38--EXPECT-- 39Cannot instantiate abstract class Foo 40Cannot instantiate interface Bar 41Cannot instantiate trait Baz 42Cannot declare self-referencing constant Abc::BAR 43