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::__construct() --FILE-- <?php enum Foo {} class Bar {} echo (new..
Decoded Output download
--TEST--
ReflectionEnum::__construct()
--FILE--
<?php
enum Foo {}
class Bar {}
echo (new ReflectionEnum(Foo::class))->getName() . "
";
try {
new ReflectionEnum('Bar');
} catch (\Exception $e) {
echo $e->getMessage() . "
";
}
try {
new ReflectionEnum('Baz');
} catch (\Exception $e) {
echo $e->getMessage() . "
";
}
try {
new ReflectionEnum([]);
} catch (Error $e) {
echo $e->getMessage() . "
";
}
?>
--EXPECT--
Foo
Class "Bar" is not an enum
Class "Baz" does not exist
ReflectionEnum::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given
Did this file decode correctly?
Original Code
--TEST--
ReflectionEnum::__construct()
--FILE--
<?php
enum Foo {}
class Bar {}
echo (new ReflectionEnum(Foo::class))->getName() . "\n";
try {
new ReflectionEnum('Bar');
} catch (\Exception $e) {
echo $e->getMessage() . "\n";
}
try {
new ReflectionEnum('Baz');
} catch (\Exception $e) {
echo $e->getMessage() . "\n";
}
try {
new ReflectionEnum([]);
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECT--
Foo
Class "Bar" is not an enum
Class "Baz" does not exist
ReflectionEnum::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given
Function Calls
None |
Stats
MD5 | 022bf6ba633dea55a0ce0307ec11f32b |
Eval Count | 0 |
Decode Time | 98 ms |