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-- runkit_import() Importing and overriding classes --SKIPIF-- <?php if(!extension_l..
Decoded Output download
--TEST--
runkit_import() Importing and overriding classes
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip";
if(array_shift(explode(".", PHP_VERSION)) < 5) print "skip";
?>
--FILE--
<?php
class MyTestClass {
public static $v = "v
";
function foo()
{
return "foo()
";
}
public function myFoo()
{
return "myFoo()
";
}
static function myStaticFoo()
{
return "myStaticFoo()
";
}
}
$obj = new MyTestClass;
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
runkit_import(dirname(__FILE__) . '/runkit_import_class.inc', RUNKIT_IMPORT_CLASS_METHODS);
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
runkit_import(dirname(__FILE__) . '/runkit_import_class.inc', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES);
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
?>
--EXPECTF--
v
foo()
myFoo()
myStaticFoo()
Notice: runkit_import(): MyTestClass::foo() already exists, not importing in %s on line %d
Notice: runkit_import(): MyTestClass::myFoo() already exists, not importing in %s on line %d
Notice: runkit_import(): MyTestClass::myStaticFoo() already exists, not importing in %s on line %d
v
foo()
myFoo()
myStaticFoo()
IMPORTED: v
IMPORTED: foo()
IMPORTED: myFoo()
IMPORTED: myStaticFoo()
Did this file decode correctly?
Original Code
--TEST--
runkit_import() Importing and overriding classes
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip";
if(array_shift(explode(".", PHP_VERSION)) < 5) print "skip";
?>
--FILE--
<?php
class MyTestClass {
public static $v = "v\n";
function foo()
{
return "foo()\n";
}
public function myFoo()
{
return "myFoo()\n";
}
static function myStaticFoo()
{
return "myStaticFoo()\n";
}
}
$obj = new MyTestClass;
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
runkit_import(dirname(__FILE__) . '/runkit_import_class.inc', RUNKIT_IMPORT_CLASS_METHODS);
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
runkit_import(dirname(__FILE__) . '/runkit_import_class.inc', RUNKIT_IMPORT_OVERRIDE | RUNKIT_IMPORT_CLASSES);
print(MyTestClass::$v);
print($obj->foo());
print($obj->myFoo());
print(MyTestClass::myStaticFoo());
?>
--EXPECTF--
v
foo()
myFoo()
myStaticFoo()
Notice: runkit_import(): MyTestClass::foo() already exists, not importing in %s on line %d
Notice: runkit_import(): MyTestClass::myFoo() already exists, not importing in %s on line %d
Notice: runkit_import(): MyTestClass::myStaticFoo() already exists, not importing in %s on line %d
v
foo()
myFoo()
myStaticFoo()
IMPORTED: v
IMPORTED: foo()
IMPORTED: myFoo()
IMPORTED: myStaticFoo()
Function Calls
extension_loaded | 1 |
Stats
MD5 | a02ce51514285629f8fb6129a490fc94 |
Eval Count | 0 |
Decode Time | 94 ms |