Example #1
0
<?php

// reduced by hand from PHPWhirl. self refers (statically) to the class its in.
class A
{
    static $B = 5;
    function x()
    {
        echo self::$B;
    }
}
$x = new A();
$x->x();
Example #2
0
    f($a = $a =& $b);
    u($a = $a =& $b);
    __var_dump($a, $b);
}
function g8()
{
    class A
    {
        static $x;
    }
    f($x->x[1][2]->a[1][2] = 1);
    f(A::$x[1] = 1);
    f(A::$x = 1);
    u($x->x[1][2]->a[1][2] = 1);
    u(A::$x[1] = 1);
    u(A::$x = 1);
}
class X
{
    private $q = 0;
    function __get($field)
    {
        echo "__get({$field}) = {$this->q}\n";
        return $this->q;
    }
    function __set($field, $value)
    {
        echo "__set({$field},{$value})\n";
        $this->q = $value;
    }
}
Example #3
0
<?php

class A
{
    const XXX = 2;
    static $x;
}
A::$x = 1;
echo A::$x;
$x = 'XXX';
echo A::$x;
Example #4
0
<?php

// Reported by Ruslan Kosolapov
class A
{
    function x()
    {
        return "str";
    }
}
$a = new A();
$filename = "{$a->x($class)}{$chain}{$class}.php";
echo $filename;