Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- ReflectionEnum::hasCase() --FILE-- <?php enum Foo { case Bar; const Baz ..

Decoded Output download

--TEST--
ReflectionEnum::hasCase()
--FILE--
<?php

enum Foo {
    case Bar;
    const Baz = self::Bar;
}

$reflectionEnum = new ReflectionEnum(Foo::class);
var_dump($reflectionEnum->hasCase('Bar'));
var_dump($reflectionEnum->hasCase('Baz'));
var_dump($reflectionEnum->hasCase('Qux'));

?>
--EXPECT--
bool(true)
bool(false)
bool(false)

Did this file decode correctly?

Original Code

--TEST--
ReflectionEnum::hasCase()
--FILE--
<?php

enum Foo {
    case Bar;
    const Baz = self::Bar;
}

$reflectionEnum = new ReflectionEnum(Foo::class);
var_dump($reflectionEnum->hasCase('Bar'));
var_dump($reflectionEnum->hasCase('Baz'));
var_dump($reflectionEnum->hasCase('Qux'));

?>
--EXPECT--
bool(true)
bool(false)
bool(false)

Function Calls

None

Variables

None

Stats

MD5 2cf6858cd10eb793b06257bfa6fd548e
Eval Count 0
Decode Time 72 ms