3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (isset($test) && $test != NULL) { echo '$test set and not null\n'; } else { echo '$test not set and not null\n'; } $test = ''; if (isset($test) && $test != NULL) { echo '$test set and not null\n'; } else { echo '$test not set and not null\n'; } if (isset($test)) { echo '$test set, even when null\n'; } $test = "abc"; if (isset($test) && $test != NULL) { echo '$test set and not null\n'; } else { echo '$test not set and not null\n'; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
$test not set and not null\n$test not set and not null\n$test set, even when null\n$test set and not null\n