<?php
// empty
echo "empty\n";
$arr = array("", 0, 0.0, "0", NULL, FALSE, array()); foreach($arr as $a)
echo "\n";
// empty_str
echo "empty_str\n";
$arr = array("", 0, 0.0, "0", NULL, FALSE, array()); foreach($arr as $a)
echo "\n";
function empty_str(&$str)
{
return empty($str) && !(isset($str) && $str === "0"); }
PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoRV9BTEwpOwoKLy8gZW1wdHkKZWNobyAiZW1wdHlcbiI7CiAKdmFyX2R1bXAoZW1wdHkoJHVuZGVmaW5lZCkpOwogCiRhcnIgPSBhcnJheSgiIiwgMCwgMC4wLCAiMCIsIE5VTEwsIEZBTFNFLCBhcnJheSgpKTsKZm9yZWFjaCgkYXJyIGFzICRhKQogICAgICAgIHZhcl9kdW1wKGVtcHR5KCRhKSk7CiAKZWNobyAiXG4iOwogCi8vIGVtcHR5X3N0cgplY2hvICJlbXB0eV9zdHJcbiI7CiAKdmFyX2R1bXAoZW1wdHlfc3RyKCR1bmRlZmluZWQpKTsKIAokYXJyID0gYXJyYXkoIiIsIDAsIDAuMCwgIjAiLCBOVUxMLCBGQUxTRSwgYXJyYXkoKSk7CmZvcmVhY2goJGFyciBhcyAkYSkKICAgICAgICB2YXJfZHVtcChlbXB0eV9zdHIoJGEpKTsKIAplY2hvICJcbiI7CiAKZnVuY3Rpb24gZW1wdHlfc3RyKCYkc3RyKQp7CiAgICAgICAgcmV0dXJuIGVtcHR5KCRzdHIpICYmICEoaXNzZXQoJHN0cikgJiYgJHN0ciA9PT0gIjAiKTsKfQo=