3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $user = new stdClass(); $user->id = 1234567; $thisObj = new stdClass(); $user2 = new stdClass(); $user2->id = 1234567; $this->user = $user2; if($user->id != $thisObj->user->id){ echo "Does not work"; } else { echo "works"; }
based on aHUZT
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Using $this when not in object context in /in/QfM2G:9 Stack trace: #0 {main} thrown in /in/QfM2G on line 9
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Fatal error: Using $this when not in object context in /in/QfM2G on line 9
Process exited with code 255.