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-- Bug #74340: Magic function __get has different behavior in php 7.1.x --FILE-- <?p..

Decoded Output download

--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
    public function __get($var)
    {
        static $first = true;
        echo '__get '.$var.PHP_EOL;
        if ($first) {
            $first = false;
            $this->$var;
            $this->{$var.'2'};
            $this->$var;
        }
    }
}

$test = new Test;
$test->test;

?>
--EXPECTF--
__get test

Warning: Undefined property: Test::$test in %s on line %d
__get test2

Warning: Undefined property: Test::$test in %s on line %d

Did this file decode correctly?

Original Code

--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
    public function __get($var)
    {
        static $first = true;
        echo '__get '.$var.PHP_EOL;
        if ($first) {
            $first = false;
            $this->$var;
            $this->{$var.'2'};
            $this->$var;
        }
    }
}

$test = new Test;
$test->test;

?>
--EXPECTF--
__get test

Warning: Undefined property: Test::$test in %s on line %d
__get test2

Warning: Undefined property: Test::$test in %s on line %d

Function Calls

None

Variables

None

Stats

MD5 b0f15d092b142b84118e51fdae7aa315
Eval Count 0
Decode Time 95 ms