3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php Class MyClass{ private $prop1; private $prop2; // this contains an array object public function __construct(){ } public function set_prop2($prop2) { $this->prop2= $prop2; // value coming from other class that returns array object } public function func1() { $var1 = ''; $var2 = $this->prop1; $var3 = $this->prop2; } } obj1 = new MyClass(); obj1->func1();
Output for 5.3.0 - 5.4.24
Parse error: syntax error, unexpected '=' in /in/sKC8b on line 24
Process exited with code 255.