3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class boo { protected $a; public __construct($a) { $this->a = $a; } } $x = new boo("X"); $y = new boo("Y"); $z = $y; var_export( $x == $y ); echo "\n"; var_export( $x == $z ); echo "\n"; var_export( $y == $z ); echo "\n"; var_export( $x === $y ); echo "\n"; var_export( $x === $z ); echo "\n"; var_export( $y === $z );
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/Qohjt on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/Qohjt on line 5
Process exited with code 255.