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_default_property_remove() function overriding objects --SKIPIF-- <?php if(..
Decoded Output download
--TEST--
runkit_default_property_remove() function overriding objects
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip";
if(array_shift(explode(".", PHP_VERSION)) < 5) print "skip";
?>
--INI--
error_reporting=E_ALL
display_errors=On
--FILE--
<?php
class RunkitClass {
public $constArray = array();
public $publicProperty = 1;
public $publicproperty = 2;
private $privateProperty = "a";
protected $protectedProperty = "b";
}
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
$className = 'RunkitClass';
$obj = new $className();
runkit_default_property_add($className, 'dynamic', $obj, RUNKIT_OVERRIDE_OBJECTS);
runkit_default_property_remove($className, 'dynamic', TRUE);
runkit_default_property_remove($className, 'publicproperty', TRUE);
runkit_default_property_remove($className, 'publicproperty', TRUE);
runkit_default_property_remove($className, 'privateProperty', TRUE);
runkit_default_property_remove($className, 'protectedProperty', TRUE);
runkit_default_property_remove($className, 'constArray', TRUE);
print_r($obj);
$obj = new stdClass();
runkit_default_property_remove('stdClass', 'str');
$obj = NULL;
?>
--EXPECTF--
Warning: runkit_default_property_remove(): RunkitClass::publicproperty does not exist in %s on line %d
RunkitClass Object
(
[publicProperty] => 1
)
Warning: runkit_default_property_remove(): Removing properties from internal classes is not allowed in %s on line %d
Did this file decode correctly?
Original Code
--TEST--
runkit_default_property_remove() function overriding objects
--SKIPIF--
<?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_MANIPULATION) print "skip";
if(array_shift(explode(".", PHP_VERSION)) < 5) print "skip";
?>
--INI--
error_reporting=E_ALL
display_errors=On
--FILE--
<?php
class RunkitClass {
public $constArray = array();
public $publicProperty = 1;
public $publicproperty = 2;
private $privateProperty = "a";
protected $protectedProperty = "b";
}
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
$className = 'RunkitClass';
$obj = new $className();
runkit_default_property_add($className, 'dynamic', $obj, RUNKIT_OVERRIDE_OBJECTS);
runkit_default_property_remove($className, 'dynamic', TRUE);
runkit_default_property_remove($className, 'publicproperty', TRUE);
runkit_default_property_remove($className, 'publicproperty', TRUE);
runkit_default_property_remove($className, 'privateProperty', TRUE);
runkit_default_property_remove($className, 'protectedProperty', TRUE);
runkit_default_property_remove($className, 'constArray', TRUE);
print_r($obj);
$obj = new stdClass();
runkit_default_property_remove('stdClass', 'str');
$obj = NULL;
?>
--EXPECTF--
Warning: runkit_default_property_remove(): RunkitClass::publicproperty does not exist in %s on line %d
RunkitClass Object
(
[publicProperty] => 1
)
Warning: runkit_default_property_remove(): Removing properties from internal classes is not allowed in %s on line %d
Function Calls
extension_loaded | 1 |
Stats
MD5 | 448613e17a0b378f9e093cb25d6e5737 |
Eval Count | 0 |
Decode Time | 88 ms |