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-- forward_static_call() calling outside of the inheritance chain. --FILE-- <?php c..

Decoded Output download

--TEST--
forward_static_call() calling outside of the inheritance chain.
--FILE--
<?php

class A
{
    const NAME = 'A';
    public static function test() {
        echo static::NAME, "
";
    }
}

class B extends A
{
    const NAME = 'B';

    public static function test() {
        echo self::NAME, "
";
        forward_static_call(array('parent', 'test'));
    }
}

class C
{
    const NAME = 'C';

    public static function test() {
        echo self::NAME, "
";
        forward_static_call(array('B', 'test'));
    }
}

A::test();
echo "-
";
B::test();
echo "-
";
C::test();

?>
--EXPECT--
A
-
B
B
-
C
B
B

Did this file decode correctly?

Original Code

--TEST--
forward_static_call() calling outside of the inheritance chain.
--FILE--
<?php

class A
{
    const NAME = 'A';
    public static function test() {
        echo static::NAME, "\n";
    }
}

class B extends A
{
    const NAME = 'B';

    public static function test() {
        echo self::NAME, "\n";
        forward_static_call(array('parent', 'test'));
    }
}

class C
{
    const NAME = 'C';

    public static function test() {
        echo self::NAME, "\n";
        forward_static_call(array('B', 'test'));
    }
}

A::test();
echo "-\n";
B::test();
echo "-\n";
C::test();

?>
--EXPECT--
A
-
B
B
-
C
B
B

Function Calls

None

Variables

None

Stats

MD5 eb49b4262f8234d6bdfde8568dde4a8a
Eval Count 0
Decode Time 89 ms