- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
- Parse error: syntax error, unexpected '=' in /in/7WfE6 on line 18
Process exited with code 255.
<?php
Class MyClass
{
private $prop1 = "foo";
private $prop2 = "bar";
public function func1()
{
global $prop1;
global $prop2;
// by declaring global variables inside this method, it works!
echo $prop1;
}
}
obj1 = new MyClass();
obj1->func1();