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() called from outside of a method. --FILE-- <?php class A { ..

Decoded Output download

--TEST--
forward_static_call() called from outside of a method.
--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'));
    }

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

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

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

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

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

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

Did this file decode correctly?

Original Code

--TEST--
forward_static_call() called from outside of a method.
--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'));
    }

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

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

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

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

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

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

Function Calls

None

Variables

None

Stats

MD5 08d0cdc1b667f609072755f4bd42a1b4
Eval Count 0
Decode Time 102 ms