<?php
class MyClass
{
protected $prop1;
public function __construct
($str = substr('hello', 0, 3)) {
echo "$str\n";
echo $this->foo1() . "\n";
echo self::foo2() . "\n";
echo $this->prop1 . "\n";
}
protected function foo1()
{
return 2 + 2;
}
protected function foo2()
{
return 3 + 3;
}
public static function foo3()
{
return 'Hello world.';
}
}
$obj = new MyClass();
PD9waHAKCmNsYXNzIE15Q2xhc3MKewogICAgcHJvdGVjdGVkICRwcm9wMTsKCiAgICBwdWJsaWMgZnVuY3Rpb24gX19jb25zdHJ1Y3QoJHN0ciA9IHN1YnN0cignaGVsbG8nLCAwLCAzKSkKICAgIHsKICAgICAgICBlY2hvICIkc3RyXG4iOwogICAgICAgIGVjaG8gJHRoaXMtPmZvbzEoKSAuICJcbiI7CiAgICAgICAgZWNobyBzZWxmOjpmb28yKCkgLiAiXG4iOwogICAgICAgIGVjaG8gJHRoaXMtPnByb3AxIC4gIlxuIjsKICAgIH0KCiAgICBwcm90ZWN0ZWQgZnVuY3Rpb24gZm9vMSgpCiAgICB7CiAgICAgICAgcmV0dXJuIDIgKyAyOwogICAgfQoKICAgIHByb3RlY3RlZCBmdW5jdGlvbiBmb28yKCkKICAgIHsKICAgICAgICByZXR1cm4gMyArIDM7CiAgICB9CgogICAgcHVibGljIHN0YXRpYyBmdW5jdGlvbiBmb28zKCkKICAgIHsKICAgICAgICByZXR1cm4gJ0hlbGxvIHdvcmxkLic7CiAgICB9Cn0KCiRvYmogPSBuZXcgTXlDbGFzcygpOw==