1--TEST-- 2ReflectionEnumUnitCase::getValue() 3--FILE-- 4<?php 5 6enum Foo { 7 case Bar; 8 case Baz; 9} 10 11$barFromReflection = (new ReflectionEnumUnitCase(Foo::class, 'Bar'))->getValue(); 12$bazFromReflection = (new ReflectionEnumUnitCase(Foo::class, 'Baz'))->getValue(); 13 14var_dump($barFromReflection); 15var_dump($bazFromReflection); 16 17var_dump(Foo::Bar === $barFromReflection); 18var_dump(Foo::Baz === $barFromReflection); 19 20var_dump(Foo::Bar === $bazFromReflection); 21var_dump(Foo::Baz === $bazFromReflection); 22 23?> 24--EXPECT-- 25enum(Foo::Bar) 26enum(Foo::Baz) 27bool(true) 28bool(false) 29bool(false) 30bool(true) 31