3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { private $id; /** * @var array */ private $other; public __construct($id,$other) { $this->id = $id; $this->other = $other; } } $a = new A(1, array( 'truc', 'bidule' => array( 'something' ) )); $b = new A(1, array( 'truc', 'bidule' => array( 'something' ) )); $c = new A(1, array( 'truc', 'bidule' => array( 'something else' ) )); var_dump($a === $b); var_dump($a == $b); var_dump($a === $c); var_dump($a == $c;
Output for 5.4.0 - 5.5.5
Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/nh6IK on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/nh6IK on line 11
Process exited with code 255.