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-- ReflectionClass::hasConstant() --CREDITS-- Robin Fernandes <[email protected]> Steve..
Decoded Output download
--TEST--
ReflectionClass::hasConstant()
--CREDITS--
Robin Fernandes <[email protected]>
Steve Seear <[email protected]>
--FILE--
<?php
class C {
const myConst = 1;
}
class D extends C {
}
$rc = new ReflectionClass("C");
echo "Check existing constant: ";
var_dump($rc->hasConstant("myConst"));
echo "Check existing constant, different case: ";
var_dump($rc->hasConstant("MyCoNsT"));
echo "Check absent constant: ";
var_dump($rc->hasConstant("doesNotExist"));
$rd = new ReflectionClass("D");
echo "Check inherited constant: ";
var_dump($rd->hasConstant("myConst"));
echo "Check absent constant: ";
var_dump($rd->hasConstant("doesNotExist"));
?>
--EXPECT--
Check existing constant: bool(true)
Check existing constant, different case: bool(false)
Check absent constant: bool(false)
Check inherited constant: bool(true)
Check absent constant: bool(false)
Did this file decode correctly?
Original Code
--TEST--
ReflectionClass::hasConstant()
--CREDITS--
Robin Fernandes <[email protected]>
Steve Seear <[email protected]>
--FILE--
<?php
class C {
const myConst = 1;
}
class D extends C {
}
$rc = new ReflectionClass("C");
echo "Check existing constant: ";
var_dump($rc->hasConstant("myConst"));
echo "Check existing constant, different case: ";
var_dump($rc->hasConstant("MyCoNsT"));
echo "Check absent constant: ";
var_dump($rc->hasConstant("doesNotExist"));
$rd = new ReflectionClass("D");
echo "Check inherited constant: ";
var_dump($rd->hasConstant("myConst"));
echo "Check absent constant: ";
var_dump($rd->hasConstant("doesNotExist"));
?>
--EXPECT--
Check existing constant: bool(true)
Check existing constant, different case: bool(false)
Check absent constant: bool(false)
Check inherited constant: bool(true)
Check absent constant: bool(false)
Function Calls
None |
Stats
MD5 | a0c1b10ef84ac3ec8dbe8e5787381ac3 |
Eval Count | 0 |
Decode Time | 81 ms |