3v4l.org

run code in 300+ PHP versions simultaneously
<?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.

preferences:
182.15 ms | 1395 KiB | 63 Q