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-- Test ReflectionProperty class constructor errors. --FILE-- <?php class TestClass..

Decoded Output download

--TEST--
Test ReflectionProperty class constructor errors.
--FILE--
<?php

class TestClass {
}

$a = 5;

echo "Non-existent class:
";
try {
    new ReflectionProperty("NonExistentClass", "prop");
} catch (ReflectionException $e) {
    echo $e->getMessage();
}

echo "

Wrong property parameter type:
";
try {
    new ReflectionProperty($a, 'TestClass');
}
catch(ReflectionException $e) {
    echo $e->getMessage();
}

echo "

Non-existent property:
";
try {
    new ReflectionProperty('TestClass', "nonExistentProperty");
}
catch(ReflectionException $e) {
    echo $e->getMessage();
}

?>
--EXPECT--
Non-existent class:
Class "NonExistentClass" does not exist

Wrong property parameter type:
Class "5" does not exist

Non-existent property:
Property TestClass::$nonExistentProperty does not exist

Did this file decode correctly?

Original Code

--TEST--
Test ReflectionProperty class constructor errors.
--FILE--
<?php

class TestClass {
}

$a = 5;

echo "Non-existent class:\n";
try {
    new ReflectionProperty("NonExistentClass", "prop");
} catch (ReflectionException $e) {
    echo $e->getMessage();
}

echo "\n\nWrong property parameter type:\n";
try {
    new ReflectionProperty($a, 'TestClass');
}
catch(ReflectionException $e) {
    echo $e->getMessage();
}

echo "\n\nNon-existent property:\n";
try {
    new ReflectionProperty('TestClass', "nonExistentProperty");
}
catch(ReflectionException $e) {
    echo $e->getMessage();
}

?>
--EXPECT--
Non-existent class:
Class "NonExistentClass" does not exist

Wrong property parameter type:
Class "5" does not exist

Non-existent property:
Property TestClass::$nonExistentProperty does not exist

Function Calls

None

Variables

None

Stats

MD5 7a60e1455d76cd788330464ca947d51a
Eval Count 0
Decode Time 70 ms