3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $reference = 0; if (is_int($reference) && $reference == 0) { var_dump('0'); } $reference = 'ex-1'; if (is_int($this->reference) && $this->reference == 0) { var_dump('ex-1'); }
based on 7r5rj
Output for 7.0.0 - 7.3.0beta1
string(1) "0" Fatal error: Uncaught Error: Using $this when not in object context in /in/GtuUl:9 Stack trace: #0 {main} thrown in /in/GtuUl on line 9
Process exited with code 255.
Output for hhvm-3.22.0
string(1) "0" Fatal error: Uncaught Error: $this is null in /in/GtuUl:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
string(1) "0" Fatal error: Uncaught Error: $this is null in /in/GtuUl:9 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
string(1) "0" Fatal error: Using $this when not in object context in /in/GtuUl on line 9
Process exited with code 255.