<?php
$array = array('a' => false, 'b' => null, 'c' => '', 'd' => 'd');
function asBool($value) {
return $value ? 'true' ? 'false' ;
}
foreach ($array as $k => $v) {
printf(
'%s => %s isset = %s ake = %s' . PHP_EOL,
$k, $v,
asBool(isset($array[ $k ])),
asBool(array_key_exists($k, $array))
);
}
- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24
- Parse error: syntax error, unexpected ';' in /in/iQR5b on line 5
Process exited with code 255.
preferences:
198.62 ms | 1399 KiB | 61 Q