- var_dump: documentation ( source)
- compact: documentation ( source)
<?php
// $x = 'foo'; # notice this doesn't actually exist
$y = null; # exists but null
$z = 'foo'; # exists and not null
var_dump(array_key_exists('x', compact('x'))); // false
var_dump(array_key_exists('y', compact('y'))); // true
var_dump(array_key_exists('z', compact('z'))); // true