3v4l.org

run code in 300+ PHP versions simultaneously
<?php $user = new stdClass(); $user->id = 1234567; $this = new stdClass(); $user2 = new stdClass(); $user2->id = 1234567; $this->user = $user2; if($user->id != $this->user->id){ echo "Does not work"; } else { echo "works"; }
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16, 7.0.0 - 7.0.1
Fatal error: Cannot re-assign $this in /in/aHUZT on line 6
Process exited with code 255.

preferences:
166.33 ms | 1387 KiB | 25 Q