3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class SubObject { static $instances = 0; public $instance; public function __construct() { $this->instance = ++self::$instances; } } class MyCloneable { public $object1; public $object2; } /* class MyCloneable { public function __invoke($object1,$object2) { $this->oject1=$object1; $this->oject2=$object2; } }*/ $obj = new MyCloneable(); $obj->object1 = new SubObject(); $obj->object2 = new SubObject(); $obj2= new $obj->object1 && new $obj->object2 print("Oggetto originale:\n"); print_r($obj); print("Oggetto originale:\n"); print_r($obj2); ?>
Output for 5.4.0 - 5.5.3
Parse error: syntax error, unexpected 'print' (T_PRINT) in /in/Le70H on line 37
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_PRINT in /in/Le70H on line 37
Process exited with code 255.