3v4l.org

run code in 200+ PHP versions simultaneously
<?php $array = []; if (@$array[$elm]) { echo 'foo'; } if (!empty($array[$elm])) { echo 'foo'; } if ($array[$elm] ?? false) { echo 'foo'; }
Output for 7.2.0 - 7.4.1
Notice: Undefined variable: elm in /in/1Z4Od on line 9 Notice: Undefined variable: elm in /in/1Z4Od on line 13