3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } $orig = ['alpha' => 1]; $tested = $orig; echo 'isset_or($tested["beta"]): ', isset_or($tested['beta'], 'nope'); var_export([ '$orig' => $orig, '$tested' => $tested, 'array_key_exists("beta")' => [ '$orig' => array_key_exists('beta', $orig), '$tested' => array_key_exists('beta', $tested), ], ]);

preferences:
12.7 ms | 458 KiB | 5 Q