1--TEST-- 2Use of self::class inside a constant in an unknown scope 3--FILE-- 4<?php 5 6class Test { 7 public function foobar() { 8 eval(" 9 const FOO = self::class; 10 var_dump(FOO); 11 "); 12 } 13} 14(new Test)->foobar(); 15 16// This should error, but doesn't 17const BAR = self::class; 18var_dump(BAR); 19 20?> 21--EXPECT-- 22string(4) "Test" 23string(0) "" 24