3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isset_or(&$check, $alternate = NULL) { return (isset($check)) ? $check : $alternate; } $test = array(); echo '$test is ', $test ? 'truthy' : 'empty', ', with ' . count($test) . ' item(s)', "\r\n"; echo '$test[0][0] is ', isset_or($test[0][0], 'not set'), "\r\n"; echo '$test is ', $test ? 'truthy' : 'empty', ', with ' . count($test) . ' item(s)', "\r\n"; echo "\r\n"; var_export($test);

preferences:
56.48 ms | 402 KiB | 5 Q