All pastes #927795 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-04 15:39 UTC
rendered paste body
$myVar = "hello";

class MyClass
{
    function __construct()
    {
        echo $myVar;
    }
}

///////////////////////////////


$myVar = "hello";

class MyClass
{
    private $myVar;

    function __construct($myVar)
    {
        $this->myVar = $myVar;
    }
}

MyClass $myClass = new MyClass($myVar);
echo $myClass->myVar;