<?php
echo "<h5>is_null()</h5>";
echo (is_null($a) ? "NULL => true" : "NULL => false") . "<br />";
echo (is_null($b) ? "'' => true" : "'' => false") . "<br />";
echo (is_null($c) ? "0 => true" : "0 => false") . "<br />";
echo (is_null($d) ? "'0' => true" : "'0' => false") . "<br />";
echo (is_null($e) ? "1 => true" : "1 => false") . "<br />";
echo (is_null($f) ? "'1' => true" : "'1' => false") . "<br />";
echo (is_null($g) ? "array() => true" : "array() => false") . "<br />";
echo (is_null($h) ? "true => true" : "true => false") . "<br />";
echo (is_null($i) ? "false => true" : "false => false") . "<br />";
echo (is_null($j) ? "object => true" : "object => false") . "<br />";
echo (is_null($k) ? "var => true" : "var => false") . "<br />";
echo (is_null($l) ? "Str null=> true" : "var => false") . "<br />";
echo "<hr />";
echo "<h5>empty()</h5>";
echo (empty($a) ? "NULL => true" : "NULL => false") . "<br />";
echo (empty($b) ? "'' => true" : "'' => false") . "<br />";
echo (empty($c) ? "0 => true" : "0 => false") . "<br />";
echo (empty($d) ? "'0' => true" : "'0' => false") . "<br />";
echo (empty($e) ? "1 => true" : "1 => false") . "<br />";
echo (empty($f) ? "'1' => true" : "'1' => false") . "<br />";
echo (empty($g) ? "array() => true" : "array() => false") . "<br />";
echo (empty($h) ? "true => true" : "true => false") . "<br />";
echo (empty($i) ? "false => true" : "false => false") . "<br />";
echo (empty($j) ? "object => true" : "object => false") . "<br />";
echo (empty($k) ? "var => true" : "var => false") . "<br />";
echo (empty($l) ? "Str null=> true" : "var => false") . "<br />";
echo (empty($m) ? "object2 => true" : "var => false") . "<br />";
echo "<hr />";
echo "<h5>isset()</h5>";
echo (isset($a) ? "NULL => true" : "NULL => false") . "<br />";
echo (isset($b) ? "'' => true" : "'' => false") . "<br />";
echo (isset($c) ? "0 => true" : "0 => false") . "<br />";
echo (isset($d) ? "'0' => true" : "'0' => false") . "<br />";
echo (isset($e) ? "1 => true" : "1 => false") . "<br />";
echo (isset($f) ? "'1' => true" : "'1' => false") . "<br />";
echo (isset($g) ? "array() => true" : "array() => false") . "<br />";
echo (isset($h) ? "true => true" : "true => false") . "<br />";
echo (isset($i) ? "false => true" : "false => false") . "<br />";
echo (isset($j) ? "object => true" : "object => false") . "<br />";
echo (isset($k) ? "var => true" : "var => false") . "<br />";
echo (isset($l) ? "Str null=> true" : "var => false") . "<br />";
?>
コメント