{"id":3772,"date":"2025-04-24T12:09:31","date_gmt":"2025-04-24T03:09:31","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3772"},"modified":"2025-04-24T12:09:34","modified_gmt":"2025-04-24T03:09:34","slug":"php%e3%81%a7%e5%9e%8b%e7%a2%ba%e8%aa%8d%e3%82%92%e6%a5%b5%e3%82%81%e3%82%8b%ef%bc%81%e5%88%9d%e5%bf%83%e8%80%85%e3%81%8b%e3%82%89%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%be%e3%81%a7%e4%bd%bf%e3%81%88","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3772","title":{"rendered":"PHP\u3067\u578b\u78ba\u8a8d\u3092\u6975\u3081\u308b\uff01\u521d\u5fc3\u8005\u304b\u3089\u4e0a\u7d1a\u8005\u307e\u3067\u4f7f\u3048\u308b7\u3064\u306e\u65b9\u6cd5\u3068\u5b9f\u8df5\u4f8b"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u91cd\u8981\u6027\u3068\u57fa\u672c<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u30d0\u30b0\u56de\u907f\u306e\u7b2c\u4e00\u6b69<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">\u5f31\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u3060\u304b\u3089\u3053\u305d\u5fc5\u8981\u306a\u578b\u78ba\u8a8d\u306e\u77e5\u8b58<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-3\">gettype\u95a2\u6570\u3067\u7c21\u5358\u306b\u578b\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-4\">gettype\u95a2\u6570\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u8fd4\u308a\u5024\u306e\u7a2e\u985e<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-5\">gettype\u95a2\u6570\u306e\u6d3b\u7528\u4f8b\u3068\u5b9f\u8df5\u7684\u306a\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-11\">is_\u7cfb\u95a2\u6570\u3092\u4f7f\u3063\u305f\u52b9\u7387\u7684\u306a\u578b\u5224\u5b9a\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-12\">\u30c7\u30fc\u30bf\u578b\u5225\u306eis_\u95a2\u6570\u4e00\u89a7\u3068\u305d\u308c\u305e\u308c\u306e\u7279\u5fb4<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-16\">is_\u7cfb\u95a2\u6570\u3092\u4f7f\u3063\u305f\u6761\u4ef6\u5206\u5c90\u306e\u66f8\u304d\u65b9\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-25\">var_dump\u95a2\u6570\u3067\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u540c\u6642\u306b\u78ba\u8a8d\u3059\u308b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-26\">\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u5a01\u529b\u3092\u767a\u63ee\u3059\u308bvar_dump\u306e\u4f7f\u3044\u65b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-33\">\u8907\u96d1\u306a\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u628a\u63e1\u306bvar_dump\u3092\u6d3b\u7528\u3059\u308b\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-38\">PHP 7\u4ee5\u964d\u306e\u53b3\u683c\u306a\u578b\u5ba3\u8a00\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-39\">\u5229\u7528\u53ef\u80fd\u306a\u578b\u5ba3\u8a00\u306e\u7a2e\u985e<\/a>      <\/li>      <li>        <a href=\"#i-40\">\u57fa\u672c\u7684\u306a\u578b\u5ba3\u8a00\u306e\u4f7f\u3044\u65b9<\/a>      <\/li>      <li>        <a href=\"#i-41\">PHP 8\u306e\u5171\u7528\u578b\uff08Union Types\uff09<\/a>      <\/li>      <li>        <a href=\"#i-42\">null\u8a31\u5bb9\u578b\u3068\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/a>      <\/li>      <li>        <a href=\"#i-43\">declare(strict_types=1)\u3067\u578b\u306e\u53b3\u683c\u3055\u3092\u9ad8\u3081\u308b\u65b9\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-50\">\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u306b\u3088\u308b\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u5411\u4e0a\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-56\">instanceof\u6f14\u7b97\u5b50\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u3092\u5224\u5b9a\u3059\u308b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-57\">\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/a>      <\/li>      <li>        <a href=\"#i-58\">instanceof \u3068 is_object() \u306e\u9055\u3044<\/a>      <\/li>      <li>        <a href=\"#i-59\">\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u30c8\u30ec\u30a4\u30c8\u306e\u5224\u5b9a<\/a>      <\/li>      <li>        <a href=\"#i-60\">\u30af\u30e9\u30b9\u968e\u5c64\u3067\u306einstanceof\u306e\u6319\u52d5<\/a>      <\/li>      <li>        <a href=\"#i-61\">\u591a\u614b\u6027\u3068instanceof\u306e\u6d3b\u7528<\/a>      <\/li>      <li>        <a href=\"#i-62\">\u52d5\u7684\u306a\u30af\u30e9\u30b9\u540d\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/a>      <\/li>      <li>        <a href=\"#i-63\">instanceof\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/a>      <\/li>      <li>        <a href=\"#i-64\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-65\">\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306binstanceof\u3092\u4f7f\u3046\u65b9\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-72\">\u7d99\u627f\u95a2\u4fc2\u306b\u3042\u308b\u30af\u30e9\u30b9\u306e\u578b\u5224\u5b9a\u6642\u306e\u6ce8\u610f\u70b9<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-81\">PHP 8\u306e\u65b0\u6a5f\u80fd\u300c\u30de\u30c3\u30c1\u5f0f\u300d\u3092\u4f7f\u3063\u305f\u578b\u306b\u3088\u308b\u5206\u5c90\u51e6\u7406<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-82\">\u30de\u30c3\u30c1\u5f0f\u3068switch\u6587\u306e\u9055\u3044<\/a>      <\/li>      <li>        <a href=\"#i-83\">\u578b\u306b\u57fa\u3065\u3044\u305f\u5206\u5c90\u306b\u30de\u30c3\u30c1\u5f0f\u3092\u6d3b\u7528\u3059\u308b<\/a>      <\/li>      <li>        <a href=\"#i-86\">\u30de\u30c3\u30c1\u5f0f\u306e\u8907\u6570\u6761\u4ef6\u3078\u306e\u5bfe\u5fdc<\/a>      <\/li>      <li>        <a href=\"#i-87\">\u6761\u4ef6\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u30de\u30c3\u30c1\u5f0f<\/a>      <\/li>      <li>        <a href=\"#i-88\">PHP 8.1\u306e\u30de\u30c3\u30c1\u5f0f\u306e\u62e1\u5f35<\/a>      <\/li>      <li>        <a href=\"#i-89\">\u30de\u30c3\u30c1\u5f0f\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-90\">switch\u6587\u3088\u308a\u3082\u76f4\u611f\u7684\u306amatch\u5f0f\u3067\u306e\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u306e\u66f8\u304d\u65b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-97\">\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u4f8b<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-106\">\u5b9f\u8df5\u7684\u306a\u578b\u78ba\u8a8d\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-107\">\u5b9f\u8df5\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-108\">\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u5165\u529b\u5024\u3092\u9069\u5207\u306b\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-113\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306b\u3088\u308b\u5805\u7262\u306a\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u5b9f\u88c5\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-119\">\u307e\u3068\u3081\uff1aPHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-120\">\u7528\u9014\u306b\u5fdc\u3058\u305f\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u9078\u3073\u65b9<\/a>      <\/li>      <li>        <a href=\"#i-121\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/a>      <\/li>      <li>        <a href=\"#i-122\">PHP 7\u30688\u3067\u306e\u578b\u95a2\u9023\u6a5f\u80fd\u306e\u6d3b\u7528\u30dd\u30a4\u30f3\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-123\">\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/a>      <\/li>      <li>        <a href=\"#i-127\">\u5c06\u6765\u7684\u306aPHP\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u5c55\u671b<\/a>      <\/li>      <li>        <a href=\"#i-128\">\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/a>      <\/li>      <li>        <a href=\"#i-129\">\u307e\u3068\u3081<\/a>      <\/li>      <li>        <a href=\"#i-130\">\u7528\u9014\u306b\u5fdc\u3058\u305f\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u9078\u3073\u65b9\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-135\">\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u91cd\u8981\u6027\u3068\u57fa\u672c<\/h2>\n\n\n\n<p>PHP\u306fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u3059\u304c\u3001\u4ed6\u306e\u591a\u304f\u306e\u8a00\u8a9e\u3068\u7570\u306a\u308a\u300c\u5f31\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u300d\u3068\u3057\u3066\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u5909\u6570\u306e\u578b\u304c\u5b9f\u884c\u6642\u306b\u52d5\u7684\u306b\u6c7a\u5b9a\u3055\u308c\u3001\u72b6\u6cc1\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u5909\u63db\u3055\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u7279\u6027\u306f\u67d4\u8edf\u6027\u3092\u3082\u305f\u3089\u3059\u4e00\u65b9\u3067\u3001\u4e88\u671f\u3057\u306a\u3044\u30d0\u30b0\u3084\u52d5\u4f5c\u306e\u539f\u56e0\u3068\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u305f\u3081\u3001PHP\u3067\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u5909\u6570\u306e\u578b\u3092\u6b63\u78ba\u306b\u628a\u63e1\u3057\u3001\u9069\u5207\u306b\u578b\u78ba\u8a8d\u3092\u884c\u3046\u3053\u3068\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002\u578b\u78ba\u8a8d\u3092\u9069\u5207\u306b\u884c\u3046\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30d0\u30b0\u306e\u65e9\u671f\u767a\u898b\u3068\u9632\u6b62<\/strong> \u2013 \u578b\u95a2\u9023\u306e\u30a8\u30e9\u30fc\u3092\u65e9\u3044\u6bb5\u968e\u3067\u767a\u898b\u3067\u304d\u308b<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u5411\u4e0a<\/strong> \u2013 \u5909\u6570\u306e\u578b\u304c\u660e\u78ba\u306b\u306a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u4f1d\u308f\u308a\u3084\u3059\u304f\u306a\u308b<\/li>\n\n\n\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/strong> \u2013 \u6b63\u3057\u3044\u578b\u306e\u4f7f\u7528\u3067\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3084\u51e6\u7406\u901f\u5ea6\u304c\u6539\u5584\u3055\u308c\u308b<\/li>\n\n\n\n<li><strong>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u5f37\u5316<\/strong> \u2013 \u578b\u30c1\u30a7\u30c3\u30af\u306b\u3088\u308b\u5165\u529b\u5024\u306e\u691c\u8a3c\u3067\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3092\u4f4e\u6e1b<\/li>\n<\/ul>\n\n\n\n<p>PHP\u8a00\u8a9e\u306b\u306f\u3001\u578b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u69d8\u3005\u306a\u95a2\u6570\u3084\u6f14\u7b97\u5b50\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u6700\u3082\u57fa\u672c\u7684\u306a\u3082\u306e\u3068\u3057\u3066<code>gettype()<\/code>\u95a2\u6570\u3084<code>is_*()<\/code>\u7cfb\u306e\u95a2\u6570\u304c\u3042\u308a\u3001\u3055\u3089\u306bPHP 7\u4ee5\u964d\u3067\u306f\u578b\u5ba3\u8a00\u6a5f\u80fd\u304c\u5f37\u5316\u3055\u308c\u3001PHP 8\u3067\u306f\u65b0\u305f\u306b\u30de\u30c3\u30c1\u5f0f\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u57fa\u672c\u304b\u3089\u5fdc\u7528\u307e\u3067\u3001\u5e45\u5e83\u3044\u65b9\u6cd5\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u521d\u5fc3\u8005\u306e\u65b9\u306f\u57fa\u672c\u7684\u306a\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u304b\u3089\u3001\u4e0a\u7d1a\u8005\u306e\u65b9\u306fPHP 7\u4ee5\u964d\u306e\u65b0\u6a5f\u80fd\u3084\u5b9f\u8df5\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u307e\u3067\u3001\u81ea\u8eab\u306e\u30b9\u30ad\u30eb\u30ec\u30d9\u30eb\u306b\u5408\u308f\u305b\u3066\u5fc5\u8981\u306a\u77e5\u8b58\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u3092\u7406\u89e3\u3057\u3001\u9069\u5207\u306a\u578b\u78ba\u8a8d\u306e\u624b\u6cd5\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u306f\u3001\u30d7\u30ed\u30d5\u30a7\u30c3\u30b7\u30e7\u30ca\u30eb\u306aPHP\u30a8\u30f3\u30b8\u30cb\u30a2\u306b\u306a\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u901a\u3058\u3066\u3001PHP\u306e\u578b\u78ba\u8a8d\u306b\u95a2\u3059\u308b\u77e5\u8b58\u3092\u6df1\u3081\u3001\u3088\u308a\u54c1\u8cea\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u30d0\u30b0\u56de\u907f\u306e\u7b2c\u4e00\u6b69<\/h3>\n\n\n\n<p>PHP\u306f\u300c\u52d5\u7684\u578b\u4ed8\u3051\u300d\u304b\u3064\u300c\u5f31\u3044\u578b\u4ed8\u3051\u300d\u306e\u8a00\u8a9e\u3067\u3059\u3002\u3053\u308c\u306f\u5909\u6570\u306e\u578b\u304c\u5b9f\u884c\u6642\u306b\u6c7a\u5b9a\u3055\u308c\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u578b\u5909\u63db\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u3053\u306e\u7279\u6027\u306f\u958b\u767a\u306e\u67d4\u8edf\u6027\u3092\u3082\u305f\u3089\u3059\u53cd\u9762\u3001\u4e88\u671f\u3057\u306a\u3044\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u3082\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>PHP\u306e\u57fa\u672c\u7684\u306a\u30c7\u30fc\u30bf\u578b\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n<div id=\"id-edb20f01-b7b5-4701-bb2e-af2722b162c6\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30c7\u30fc\u30bf\u578b<\/th><th>\u8aac\u660e<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>boolean<\/td><td>\u771f\u507d\u5024<\/td><td>true, false<\/td><\/tr><tr><td>integer<\/td><td>\u6574\u6570<\/td><td>42, -7<\/td><\/tr><tr><td>float<\/td><td>\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570<\/td><td>3.14, -0.1<\/td><\/tr><tr><td>string<\/td><td>\u6587\u5b57\u5217<\/td><td>\u201cHello\u201d, \u2018PHP\u2019<\/td><\/tr><tr><td>array<\/td><td>\u914d\u5217<\/td><td>[1, 2, 3], [\u201ca\u201d =&gt; \u201cApple\u201d]<\/td><\/tr><tr><td>object<\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/td><td>new stdClass()<\/td><\/tr><tr><td>NULL<\/td><td>NULL\u5024<\/td><td>NULL<\/td><\/tr><tr><td>resource<\/td><td>\u30ea\u30bd\u30fc\u30b9<\/td><td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u306a\u3069<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u843d\u3068\u3057\u7a74\u306e\u4e00\u3064\u306b\u3001\u81ea\u52d5\u578b\u5909\u63db\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u30b3\u30fc\u30c9\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6570\u5024\u3068\u6587\u5b57\u5217\u306e\u6bd4\u8f03\n$a = 5;\n$b = \"5\";\nif ($a == $b) {  \/\/ true - \u5024\u306f\u540c\u3058\u3068\u5224\u5b9a\u3055\u308c\u308b\n    echo \"\u540c\u3058\u5024\u3067\u3059\";\n}\nif ($a === $b) { \/\/ false - \u578b\u304c\u9055\u3046\u305f\u3081\u4e0d\u4e00\u81f4\u3068\u5224\u5b9a\u3055\u308c\u308b\n    echo \"\u3053\u306e\u884c\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\";\n}\n\n\/\/ \u7a7a\u306e\u5024\u306e\u6bd4\u8f03\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u4f8b\n$c = \"\";\n$d = 0;\n$e = [];\nif ($c == $d) {  \/\/ true - \u7a7a\u6587\u5b57\u30680\u306f\u540c\u3058\u3068\u5224\u5b9a\u3055\u308c\u308b\n    echo \"\u3053\u308c\u306f\u5b9f\u884c\u3055\u308c\u307e\u3059\";\n}\nif ($d == $e) {  \/\/ true - 0\u3068\u7a7a\u914d\u5217\u306f\u540c\u3058\u3068\u5224\u5b9a\u3055\u308c\u308b\n    echo \"\u3053\u308c\u3082\u5b9f\u884c\u3055\u308c\u307e\u3059\";\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u81ea\u52d5\u578b\u5909\u63db\u306f\u30d0\u30b0\u306e\u539f\u56e0\u306b\u306a\u308a\u3084\u3059\u3044\u305f\u3081\u3001\u578b\u3092\u610f\u8b58\u3057\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u304c\u91cd\u8981\u3067\u3059\u3002\u30d0\u30b0\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u30dd\u30a4\u30f3\u30c8\u306f\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u306a\u6bd4\u8f03\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b<\/strong> \u2013 <code>==<\/code>\u3088\u308a<code>===<\/code>\u3092\u512a\u5148\u3059\u308b<\/li>\n\n\n\n<li><strong>\u578b\u5909\u63db\u3092\u660e\u793a\u7684\u306b\u884c\u3046<\/strong> \u2013 \u6697\u9ed9\u306e\u578b\u5909\u63db\u306b\u983c\u3089\u306a\u3044<\/li>\n\n\n\n<li><strong>\u5909\u6570\u306e\u578b\u3092\u5e38\u306b\u628a\u63e1\u3059\u308b<\/strong> \u2013 \u578b\u78ba\u8a8d\u95a2\u6570\u3092\u6d3b\u7528\u3059\u308b<\/li>\n\n\n\n<li><strong>\u95a2\u6570\u306e\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u3092\u7406\u89e3\u3059\u308b<\/strong> \u2013 \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u78ba\u8a8d\u3059\u308b\u7fd2\u6163\u3092\u3064\u3051\u308b<\/li>\n<\/ol>\n\n\n\n<p>PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u591a\u304f\u306e\u4e00\u822c\u7684\u306a\u30d0\u30b0\u3092\u672a\u7136\u306b\u9632\u304e\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">\u5f31\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u3060\u304b\u3089\u3053\u305d\u5fc5\u8981\u306a\u578b\u78ba\u8a8d\u306e\u77e5\u8b58<\/h3>\n\n\n\n<p>PHP\u306f\u300c\u5f31\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u300d\u306b\u5206\u985e\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u5909\u6570\u306e\u578b\u3092\u53b3\u683c\u306b\u30c1\u30a7\u30c3\u30af\u305b\u305a\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u81ea\u52d5\u7684\u306b\u578b\u5909\u63db\u3092\u884c\u3046\u7279\u6027\u3092\u6301\u3064\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002\u5bfe\u7167\u7684\u306b\u300c\u5f37\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u300d\uff08Java\u3001C#\u3001TypeScript\u306a\u3069\uff09\u3067\u306f\u3001\u7570\u306a\u308b\u578b\u306e\u9593\u3067\u660e\u793a\u7684\u306a\u5909\u63db\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u5f31\u3044\u578b\u4ed8\u3051\u306e\u7279\u6027\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u304c\u554f\u984c\u306a\u304f\u52d5\u4f5c\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6587\u5b57\u5217\u3068\u6570\u5024\u306e\u81ea\u52d5\u5909\u63db\n$number = 5;\n$string = \"10\";\n$result = $number + $string;  \/\/ \u7d50\u679c\u306f 15 (\u6574\u6570)\n\n\/\/ \u6587\u5b57\u5217\u9023\u7d50\n$concat = $number . $string;  \/\/ \u7d50\u679c\u306f \"510\" (\u6587\u5b57\u5217)\n\n\/\/ \u6761\u4ef6\u5f0f\u3067\u306e\u578b\u5909\u63db\n$emptyArray = [];\n$zero = 0;\nif ($emptyArray == $zero) {  \/\/ true \u306b\u306a\u308b\n    echo \"\u7a7a\u914d\u5217\u30680\u306f==\u3067\u306f\u540c\u3058\u3068\u5224\u5b9a\u3055\u308c\u308b\";\n}\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u67d4\u8edf\u6027\u306f\u4fbf\u5229\u306a\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u610f\u56f3\u3057\u306a\u3044\u578b\u5909\u63db\u306b\u3088\u308b\u8ad6\u7406\u30a8\u30e9\u30fc<\/strong> \u2013 \u4f8b\u3048\u3070\u3001\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f \u201c0\u201d (\u6587\u5b57\u5217) \u3068 0 (\u6570\u5024) \u306e\u6bd4\u8f03<\/li>\n\n\n\n<li><strong>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af<\/strong> \u2013 \u578b\u5909\u63db\u306b\u3088\u308b\u5165\u529b\u691c\u8a3c\u306e\u30d0\u30a4\u30d1\u30b9<\/li>\n\n\n\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u4f4e\u4e0b<\/strong> \u2013 \u4e0d\u5fc5\u8981\u306a\u578b\u5909\u63db\u306b\u3088\u308b\u51e6\u7406\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u306b\u304f\u3055<\/strong> \u2013 \u5909\u6570\u306e\u578b\u304c\u4e0d\u660e\u78ba\u306b\u306a\u308b<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u3001PHP\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u578b\u78ba\u8a8d\u306e\u624b\u6cd5\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u306a\u6bd4\u8f03\u6f14\u7b97\u5b50\u306e\u4f7f\u7528<\/strong> (<code>===<\/code>, <code>!==<\/code>)<\/li>\n\n\n\n<li><strong>is_\u7cfb\u95a2\u6570\u306b\u3088\u308b\u578b\u30c1\u30a7\u30c3\u30af<\/strong> (<code>is_string()<\/code>, <code>is_int()<\/code> \u306a\u3069)<\/li>\n\n\n\n<li><strong>\u660e\u793a\u7684\u306a\u578b\u5909\u63db<\/strong> (<code>(int)<\/code>, <code>(string)<\/code> \u306a\u3069)<\/li>\n\n\n\n<li><strong>PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u6a5f\u80fd\u306e\u6d3b\u7528<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u7279\u306b\u4ee5\u4e0b\u306e\u30b7\u30c1\u30e5\u30a8\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u578b\u78ba\u8a8d\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u51e6\u7406<\/li>\n\n\n\n<li>API\u304b\u3089\u306e\u30c7\u30fc\u30bf\u51e6\u7406<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u306e\u53d6\u5f97\u7d50\u679c\u51e6\u7406<\/li>\n\n\n\n<li>\u6761\u4ef6\u5206\u5c90\u306e\u5236\u5fa1<\/li>\n<\/ul>\n\n\n\n<p>\u5f31\u3044\u578b\u4ed8\u3051\u8a00\u8a9e\u306e\u67d4\u8edf\u6027\u3092\u6d3b\u304b\u3057\u3064\u3064\u3001\u305d\u306e\u843d\u3068\u3057\u7a74\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001\u5e38\u306b\u5909\u6570\u306e\u578b\u3092\u610f\u8b58\u3057\u3001\u9069\u5207\u306a\u578b\u78ba\u8a8d\u3092\u884c\u3046\u7fd2\u6163\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-3\">gettype\u95a2\u6570\u3067\u7c21\u5358\u306b\u578b\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>PHP\u3067\u5909\u6570\u306e\u578b\u3092\u78ba\u8a8d\u3059\u308b\u6700\u3082\u57fa\u672c\u7684\u304b\u3064\u30b7\u30f3\u30d7\u30eb\u306a\u65b9\u6cd5\u306f\u3001<code>gettype()<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u5358\u4e00\u306e\u5f15\u6570\u3068\u3057\u3066\u4efb\u610f\u306e\u5909\u6570\u3092\u53d7\u3051\u53d6\u308a\u3001\u305d\u306e\u578b\u3092\u8868\u3059\u6587\u5b57\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u3001PHP\u306e\u3059\u3079\u3066\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\uff08PHP 4\u304b\u3089PHP 8\u307e\u3067\uff09\u3067\u5229\u7528\u53ef\u80fd\u306a\u6a19\u6e96\u95a2\u6570\u3067\u3042\u308a\u3001\u7279\u5225\u306a\u8a2d\u5b9a\u3084\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u30b7\u30f3\u30d7\u30eb\u3055\u304b\u3089\u3001PHP\u306e\u578b\u78ba\u8a8d\u306e\u57fa\u672c\u3068\u3057\u3066\u591a\u304f\u306e\u958b\u767a\u8005\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u95a2\u6570\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u69cb\u6587\u3067\u4f7f\u7528\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u69cb\u6587\nstring gettype(mixed $variable);\n\n\/\/ \u4f7f\u7528\u4f8b\n$type = gettype($variable);\necho \"\u5909\u6570\u306e\u578b\u306f \" . $type . \" \u3067\u3059\";\n<\/pre>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u5909\u6570\u306e\u578b\u306b\u5fdc\u3058\u3066\u3001\u4ee5\u4e0b\u306e\u3044\u305a\u308c\u304b\u306e\u6587\u5b57\u5217\u3092\u8fd4\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\"boolean\"<\/code> \u2013 \u771f\u507d\u5024\uff08true\/false\uff09<\/li>\n\n\n\n<li><code>\"integer\"<\/code> \u2013 \u6574\u6570<\/li>\n\n\n\n<li><code>\"double\"<\/code> \u2013 \u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\uff08\u6ce8\u610f\uff1a\u300cfloat\u300d\u3067\u306f\u306a\u304f\u300cdouble\u300d\u3092\u8fd4\u3057\u307e\u3059\uff09<\/li>\n\n\n\n<li><code>\"string\"<\/code> \u2013 \u6587\u5b57\u5217<\/li>\n\n\n\n<li><code>\"array\"<\/code> \u2013 \u914d\u5217<\/li>\n\n\n\n<li><code>\"object\"<\/code> \u2013 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/li>\n\n\n\n<li><code>\"resource\"<\/code> \u2013 \u30ea\u30bd\u30fc\u30b9\uff08\u30d5\u30a1\u30a4\u30eb\u30cf\u30f3\u30c9\u30eb\u306a\u3069\uff09<\/li>\n\n\n\n<li><code>\"resource (closed)\"<\/code> \u2013 \u9589\u3058\u3089\u308c\u305f\u30ea\u30bd\u30fc\u30b9\uff08PHP 7.2\u4ee5\u964d\uff09<\/li>\n\n\n\n<li><code>\"NULL\"<\/code> \u2013 NULL\u5024<\/li>\n\n\n\n<li><code>\"unknown type\"<\/code> \u2013 \u305d\u306e\u4ed6\u306e\u672a\u77e5\u306e\u578b<\/li>\n<\/ul>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3042\u308b\u304c\u3086\u3048\u306b\u3001\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u3001\u52d5\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u306b\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306f\u3001\u5f8c\u8ff0\u3059\u308b<code>is_*()<\/code>\u7cfb\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u304c\u52b9\u7387\u7684\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-4\">gettype\u95a2\u6570\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3068\u8fd4\u308a\u5024\u306e\u7a2e\u985e<\/h3>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306a\u95a2\u6570\u3067\u3001\u3069\u306e\u3088\u3046\u306a\u5909\u6570\u3067\u3082\u5f15\u6570\u3068\u3057\u3066\u6e21\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ gettype\u95a2\u6570\u306e\u57fa\u672c\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\n$value = 42;\necho gettype($value); \/\/ \"integer\"\u3092\u51fa\u529b\n\n\/\/ \u5909\u6570\u306e\u578b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u7570\u306a\u308b\u51e6\u7406\u3092\u884c\u3046\u4f8b\n$value = \"Hello\";\nif (gettype($value) === \"string\") {\n    echo \"\u3053\u308c\u306f\u6587\u5b57\u5217\u3067\u3059\";\n} else {\n    echo \"\u3053\u308c\u306f\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\";\n}\n<\/pre>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u304c\u8fd4\u3059\u53ef\u80fd\u6027\u306e\u3042\u308b\u5024\u306f\u4ee5\u4e0b\u306e\u8868\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n<div id=\"id-9282211a-82f3-4c9f-a870-fc74d41677fb\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u8fd4\u308a\u5024<\/th><th>\u5bfe\u5fdc\u3059\u308bPHP\u306e\u578b<\/th><th>\u4f8b<\/th><\/tr><\/thead><tbody><tr><td>\u201cboolean\u201d<\/td><td>\u8ad6\u7406\u578b<\/td><td>true, false<\/td><\/tr><tr><td>\u201cinteger\u201d<\/td><td>\u6574\u6570\u578b<\/td><td>42, -1, 0<\/td><\/tr><tr><td>\u201cdouble\u201d<\/td><td>\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b<\/td><td>3.14, -0.1, 1.0<\/td><\/tr><tr><td>\u201cstring\u201d<\/td><td>\u6587\u5b57\u5217\u578b<\/td><td>\u201cHello\u201d, \u201d, \u201c42\u201d<\/td><\/tr><tr><td>\u201carray\u201d<\/td><td>\u914d\u5217\u578b<\/td><td>[1, 2, 3], [\u201cname\u201d =&gt; \u201cJohn\u201d]<\/td><\/tr><tr><td>\u201cobject\u201d<\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u578b<\/td><td>new stdClass()<\/td><\/tr><tr><td>\u201cresource\u201d<\/td><td>\u30ea\u30bd\u30fc\u30b9\u578b<\/td><td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3001\u30d5\u30a1\u30a4\u30eb\u30cf\u30f3\u30c9\u30eb<\/td><\/tr><tr><td>\u201cresource (closed)\u201d<\/td><td>\u9589\u3058\u3089\u308c\u305f\u30ea\u30bd\u30fc\u30b9\u578b<\/td><td>fclose()\u5f8c\u306e\u30d5\u30a1\u30a4\u30eb\u30cf\u30f3\u30c9\u30eb (PHP 7.2\u4ee5\u964d)<\/td><\/tr><tr><td>\u201cNULL\u201d<\/td><td>NULL\u578b<\/td><td>NULL<\/td><\/tr><tr><td>\u201cunknown type\u201d<\/td><td>\u672a\u77e5\u306e\u578b<\/td><td>(\u307e\u308c)<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u4ee5\u4e0b\u306f\u5404\u30c7\u30fc\u30bf\u578b\u306e\u5b9f\u969b\u306e\u4f7f\u7528\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u69d8\u3005\u306a\u578b\u306e\u5909\u6570\u3067gettype()\u3092\u4f7f\u7528\u3059\u308b\u4f8b\n$boolVal = true;\n$intVal = 100;\n$floatVal = 3.14;\n$strVal = \"PHP\";\n$arrayVal = [\"red\", \"green\", \"blue\"];\n$objVal = new stdClass();\n$nullVal = NULL;\n$fileResource = fopen(\"example.txt\", \"r\"); \/\/ \u30ea\u30bd\u30fc\u30b9\u306e\u4f8b\n\necho \"bool: \" . gettype($boolVal) . \"\\n\";      \/\/ \"boolean\"\necho \"int: \" . gettype($intVal) . \"\\n\";        \/\/ \"integer\"\necho \"float: \" . gettype($floatVal) . \"\\n\";    \/\/ \"double\" (\u6ce8\u610f: float\u3067\u306f\u306a\u3044)\necho \"string: \" . gettype($strVal) . \"\\n\";     \/\/ \"string\"\necho \"array: \" . gettype($arrayVal) . \"\\n\";    \/\/ \"array\"\necho \"object: \" . gettype($objVal) . \"\\n\";     \/\/ \"object\"\necho \"null: \" . gettype($nullVal) . \"\\n\";      \/\/ \"NULL\"\necho \"resource: \" . gettype($fileResource) . \"\\n\"; \/\/ \"resource\"\n\n\/\/ \u30ea\u30bd\u30fc\u30b9\u3092\u9589\u3058\u305f\u5f8c\u306e\u4f8b\uff08PHP 7.2\u4ee5\u964d\uff09\nfclose($fileResource);\necho \"\u9589\u3058\u305f\u30ea\u30bd\u30fc\u30b9: \" . gettype($fileResource) . \"\\n\"; \/\/ \"resource (closed)\"\n<\/pre>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306f\u300cfloat\u300d\u3067\u306f\u306a\u304f\u300cdouble\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002\u3053\u308c\u306fPHP\u5185\u90e8\u3067\u306e\u578b\u8868\u73fe\u306b\u57fa\u3065\u3044\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>gettype()<\/code>\u306f\u578b\u540d\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3059\u305f\u3081\u3001\u6bd4\u8f03\u306b\u306f\u6587\u5b57\u5217\u6bd4\u8f03\uff08===\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306f\u3001\u5f8c\u8ff0\u3059\u308b<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u304c\u52b9\u7387\u7684\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>gettype()<\/code>\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30af\u30e9\u30b9\u540d\u306f\u8fd4\u3057\u307e\u305b\u3093\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30af\u30e9\u30b9\u3092\u77e5\u308b\u306b\u306f<code>get_class()<\/code>\u95a2\u6570\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u30c7\u30d0\u30c3\u30b0\u3084\u30ed\u30b0\u51fa\u529b\u306b\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u304c\u3001\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3067\u983b\u7e41\u306b\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u5834\u5408\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u89b3\u70b9\u304b\u3089<code>is_*()<\/code>\u7cfb\u95a2\u6570\u306e\u4f7f\u7528\u3092\u691c\u8a0e\u3059\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">gettype\u95a2\u6570\u306e\u6d3b\u7528\u4f8b\u3068\u5b9f\u8df5\u7684\u306a\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb<\/h3>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u3001\u5358\u7d14\u306a\u69cb\u9020\u306a\u304c\u3089\u69d8\u3005\u306a\u30b7\u30fc\u30f3\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u5b9f\u969b\u306e\u958b\u767a\u3067\u5f79\u7acb\u3064\u5b9f\u8df5\u7684\u306a\u6d3b\u7528\u4f8b\u3068\u30b3\u30fc\u30c9\u30b5\u30f3\u30d7\u30eb\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-6\">1. \u30c7\u30d0\u30c3\u30b0\u3068\u30ed\u30b0\u51fa\u529b<\/h4>\n\n\n\n<p>\u958b\u767a\u4e2d\u306e\u30c7\u30d0\u30c3\u30b0\u3084\u30a8\u30e9\u30fc\u30ed\u30b0\u51fa\u529b\u306b<code>gettype()<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u671f\u5f85\u3057\u305f\u578b\u3068\u5b9f\u969b\u306e\u578b\u304c\u4e00\u81f4\u3057\u306a\u3044\u554f\u984c\u3092\u7d20\u65e9\u304f\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u306e\u4f8b\nfunction debug_var($var, $name = 'variable') {\n    $type = gettype($var);\n    $value = ($type === 'array' || $type === 'object') \n        ? print_r($var, true) \n        : (string)$var;\n    \n    error_log(\"DEBUG: {$name} is type '{$type}' with value: {$value}\");\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$user_input = $_POST['age'] ?? null;\ndebug_var($user_input, 'user_age'); \/\/ \"DEBUG: user_age is type 'string' with value: 30\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-7\">2. \u578b\u306b\u57fa\u3065\u3044\u305f\u51e6\u7406\u306e\u5206\u5c90<\/h4>\n\n\n\n<p>\u5909\u6570\u306e\u578b\u306b\u5fdc\u3058\u3066\u7570\u306a\u308b\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306b<code>gettype()<\/code>\u3092\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function process_value($value) {\n    switch (gettype($value)) {\n        case 'string':\n            return '\u30c6\u30ad\u30b9\u30c8: ' . $value;\n        \n        case 'integer':\n        case 'double':\n            return '\u6570\u5024: ' . $value;\n            \n        case 'array':\n            return '\u914d\u5217\u306e\u8981\u7d20\u6570: ' . count($value);\n            \n        case 'object':\n            return '\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30af\u30e9\u30b9: ' . get_class($value);\n            \n        case 'NULL':\n            return '\u5024\u304c\u3042\u308a\u307e\u305b\u3093';\n            \n        default:\n            return '\u672a\u30b5\u30dd\u30fc\u30c8\u306e\u578b\u3067\u3059';\n    }\n}\n\necho process_value(\"Hello\");        \/\/ \u30c6\u30ad\u30b9\u30c8: Hello\necho process_value(42);             \/\/ \u6570\u5024: 42\necho process_value([1, 2, 3]);      \/\/ \u914d\u5217\u306e\u8981\u7d20\u6570: 3\necho process_value(new DateTime()); \/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30af\u30e9\u30b9: DateTime\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-8\">3. JSON API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u691c\u8a3c<\/h4>\n\n\n\n<p>API\u304b\u3089\u306eJSON\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\u3059\u308b\u969b\u3001\u671f\u5f85\u3059\u308b\u578b\u3068\u5b9f\u969b\u306e\u578b\u3092\u78ba\u8a8d\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function validate_api_response($response, $expected_schema) {\n    foreach ($expected_schema as $key =&gt; $expected_type) {\n        if (!isset($response[$key])) {\n            return false; \/\/ \u30ad\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\n        }\n        \n        $actual_type = gettype($response[$key]);\n        if ($actual_type !== $expected_type) {\n            error_log(\"API\u30a8\u30e9\u30fc: {$key}\u306e\u578b\u304c{$expected_type}\u3067\u306f\u306a\u304f{$actual_type}\u3067\u3057\u305f\u3002\");\n            return false;\n        }\n    }\n    return true;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$api_response = json_decode($json_string, true);\n$expected_types = [\n    'id' =&gt; 'integer',\n    'name' =&gt; 'string',\n    'active' =&gt; 'boolean',\n    'settings' =&gt; 'array'\n];\n\nif (validate_api_response($api_response, $expected_types)) {\n    \/\/ \u6b63\u5e38\u306b\u51e6\u7406\u3092\u7d9a\u884c\n} else {\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-9\">4. \u52d5\u7684\u306a\u5909\u6570\u60c5\u5831\u306e\u8868\u793a<\/h4>\n\n\n\n<p>\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u8868\u793a\u3059\u308b\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u95a2\u6570\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function describe_variable($var) {\n    $type = gettype($var);\n    $description = \"\u578b: {$type}, \";\n    \n    switch ($type) {\n        case 'array':\n            $description .= \"\u8981\u7d20\u6570: \" . count($var);\n            break;\n            \n        case 'object':\n            $description .= \"\u30af\u30e9\u30b9: \" . get_class($var);\n            break;\n            \n        case 'resource':\n            $description .= \"\u30ea\u30bd\u30fc\u30b9\u30bf\u30a4\u30d7: \" . get_resource_type($var);\n            break;\n            \n        case 'string':\n            $description .= \"\u9577\u3055: \" . strlen($var) . \", \u5024: '{$var}'\";\n            break;\n            \n        default:\n            $description .= \"\u5024: \" . (string)$var;\n    }\n    \n    return $description;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$date = new DateTime();\necho describe_variable($date); \/\/ \"\u578b: object, \u30af\u30e9\u30b9: DateTime\"\n\n$numbers = [1, 2, 3, 4, 5];\necho describe_variable($numbers); \/\/ \"\u578b: array, \u8981\u7d20\u6570: 5\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-10\">5. gettype\u95a2\u6570\u306e\u9650\u754c\u3092\u514b\u670d\u3059\u308b\u4f8b<\/h4>\n\n\n\n<p><code>gettype()<\/code>\u306f\u578b\u306e\u540d\u524d\u3057\u304b\u8fd4\u3055\u306a\u3044\u305f\u3081\u3001\u3088\u308a\u8a73\u7d30\u306a\u60c5\u5831\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u4ed6\u306e\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3068\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function enhanced_type_info($var) {\n    $base_type = gettype($var);\n    $info = ['type' =&gt; $base_type];\n    \n    if ($base_type === 'object') {\n        $info['class'] = get_class($var);\n        $info['interfaces'] = class_implements($var);\n        $info['parent'] = get_parent_class($var);\n    } \n    elseif ($base_type === 'array') {\n        $info['count'] = count($var);\n        $info['is_associative'] = array_keys($var) !== range(0, count($var) - 1);\n    }\n    elseif ($base_type === 'resource') {\n        $info['resource_type'] = get_resource_type($var);\n    }\n    \n    return $info;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$obj = new Exception(\"\u30c6\u30b9\u30c8\u30a8\u30e9\u30fc\");\nprint_r(enhanced_type_info($obj));\n\/\/ Array ( [type] =&gt; object [class] =&gt; Exception [interfaces] =&gt; Array(...) [parent] =&gt; Throwable )\n<\/pre>\n\n\n\n<p><code>gettype()<\/code>\u95a2\u6570\u306f\u5358\u7d14\u3067\u3042\u308a\u306a\u304c\u3089\u3001\u69d8\u3005\u306a\u30b7\u30fc\u30f3\u3067\u6d3b\u7528\u3067\u304d\u308b\u4fbf\u5229\u306a\u95a2\u6570\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u5834\u5408\u3084\u3001\u3088\u308a\u8a73\u7d30\u306a\u578b\u60c5\u5831\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u6b21\u7ae0\u3067\u8aac\u660e\u3059\u308b<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3084\u4ed6\u306e\u5c02\u7528\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-11\">is_\u7cfb\u95a2\u6570\u3092\u4f7f\u3063\u305f\u52b9\u7387\u7684\u306a\u578b\u5224\u5b9a\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<p>PHP\u306b\u306f\u3001<code>gettype()<\/code>\u95a2\u6570\u306b\u52a0\u3048\u3066\u3001\u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<code>is_*()<\/code>\u7cfb\u95a2\u6570\u304c\u591a\u6570\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u3001\u578b\u306e\u540d\u524d\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3059<code>gettype()<\/code>\u3068\u306f\u7570\u306a\u308a\u3001\u5909\u6570\u304c\u6307\u5b9a\u3055\u308c\u305f\u578b\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u771f\u507d\u5024\uff08true\/false\uff09\u3067\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>is_*()<\/code>\u7cfb\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306b\u3001\u3088\u308a\u76f4\u611f\u7684\u3067\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u9762\u3067\u3082\u3001<code>gettype()<\/code>\u95a2\u6570\u3068\u6587\u5b57\u5217\u6bd4\u8f03\u3092\u884c\u3046\u3088\u308a\u3082\u9ad8\u901f\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001PHP\u3067\u983b\u7e41\u306b\u4f7f\u7528\u3055\u308c\u308b\u4e3b\u8981\u306a<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3067\u3059\uff1a<\/p>\n\n\n<div id=\"id-b8927ae1-80b7-44b3-b4dd-2a7486e04477\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u95a2\u6570\u540d<\/th><th>\u8aac\u660e<\/th><th>\u623b\u308a\u5024<\/th><\/tr><\/thead><tbody><tr><td><code>is_null()<\/code><\/td><td>\u5909\u6570\u304cNULL\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_bool()<\/code><\/td><td>\u5909\u6570\u304c\u8ad6\u7406\u578b\uff08true\/false\uff09\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_int()<\/code> \/ <code>is_integer()<\/code><\/td><td>\u5909\u6570\u304c\u6574\u6570\u578b\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_float()<\/code> \/ <code>is_double()<\/code><\/td><td>\u5909\u6570\u304c\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_string()<\/code><\/td><td>\u5909\u6570\u304c\u6587\u5b57\u5217\u578b\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_array()<\/code><\/td><td>\u5909\u6570\u304c\u914d\u5217\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_object()<\/code><\/td><td>\u5909\u6570\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_resource()<\/code><\/td><td>\u5909\u6570\u304c\u30ea\u30bd\u30fc\u30b9\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_scalar()<\/code><\/td><td>\u5909\u6570\u304c\u30b9\u30ab\u30e9\u30fc\u578b\uff08\u6574\u6570\u3001\u6d6e\u52d5\u5c0f\u6570\u70b9\u3001\u6587\u5b57\u5217\u3001\u8ad6\u7406\u5024\uff09\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_numeric()<\/code><\/td><td>\u5909\u6570\u304c\u6570\u5024\u307e\u305f\u306f\u6570\u5024\u5f62\u5f0f\u306e\u6587\u5b57\u5217\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_callable()<\/code><\/td><td>\u5909\u6570\u304c\u547c\u3073\u51fa\u3057\u53ef\u80fd\u306a\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u304b\u3069\u3046\u304b<\/td><td>bool<\/td><\/tr><tr><td><code>is_iterable()<\/code><\/td><td>\u5909\u6570\u304c\u914d\u5217\u307e\u305f\u306fTraversable\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\uff08PHP 7.1\u4ee5\u964d\uff09<\/td><td>bool<\/td><\/tr><tr><td><code>is_countable()<\/code><\/td><td>\u5909\u6570\u304c\u914d\u5217\u307e\u305f\u306fCountable\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\uff08PHP 7.3\u4ee5\u964d\uff09<\/td><td>bool<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001<code>gettype()<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u305f\u5834\u5408\u3088\u308a\u3082\u8aad\u307f\u3084\u3059\u304f\u3001\u52b9\u7387\u7684\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5404<code>is_*()<\/code>\u7cfb\u95a2\u6570\u306e\u8a73\u7d30\u306a\u4f7f\u3044\u65b9\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">\u30c7\u30fc\u30bf\u578b\u5225\u306eis_\u95a2\u6570\u4e00\u89a7\u3068\u305d\u308c\u305e\u308c\u306e\u7279\u5fb4<\/h3>\n\n\n\n<p>PHP\u306e<code>is_*()<\/code>\u7cfb\u95a2\u6570\u306f\u578b\u3054\u3068\u306b\u5c02\u7528\u306e\u95a2\u6570\u304c\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u308c\u305e\u308c\u7279\u5fb4\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u578b\u30ab\u30c6\u30b4\u30ea\u30fc\u5225\u306b\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-13\">\u57fa\u672c\u30c7\u30fc\u30bf\u578b\u306e\u5224\u5b9a\u95a2\u6570<\/h4>\n\n\n\n<p><strong>1. <code>is_null(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304cNULL\u5024\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = NULL;\n$var2 = 0;\nvar_dump(is_null($var1)); \/\/ bool(true)\nvar_dump(is_null($var2)); \/\/ bool(false)\n\n\/\/ \u672a\u5b9a\u7fa9\u5909\u6570\u306b\u76f4\u63a5\u4f7f\u7528\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\n\/\/ var_dump(is_null($undefined)); \/\/ \u30a8\u30e9\u30fc: Undefined variable\n\n\/\/ \u4ee5\u4e0b\u306e\u3088\u3046\u306b isset() \u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u304b\u3001null\u5408\u4f53\u6f14\u7b97\u5b50(??)\u3092\u4f7f\u3046\u3068\u3088\u3044\nvar_dump(isset($undefined) ? !is_null($undefined) : false); \/\/ bool(false)\n<\/pre>\n\n\n\n<p><strong>2. <code>is_bool(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u8ad6\u7406\u578b\uff08boolean\uff09\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = true;\n$var2 = false;\n$var3 = 1;\n$var4 = \"true\";\n\nvar_dump(is_bool($var1)); \/\/ bool(true)\nvar_dump(is_bool($var2)); \/\/ bool(true)\nvar_dump(is_bool($var3)); \/\/ bool(false) - \u6570\u5024\u306e1\u306ftrue\u3068\u7b49\u4fa1\u3067\u3082\u8ad6\u7406\u578b\u3067\u306f\u306a\u3044\nvar_dump(is_bool($var4)); \/\/ bool(false) - \u6587\u5b57\u5217\"true\"\u306f\u8ad6\u7406\u578b\u3067\u306f\u306a\u3044\n<\/pre>\n\n\n\n<p><strong>3. <code>is_int(mixed $var): bool<\/code> \/ <code>is_integer(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u6574\u6570\u578b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002\u4e21\u95a2\u6570\u306f\u5b8c\u5168\u306b\u540c\u3058\u52d5\u4f5c\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = 42;\n$var2 = \"42\";\n$var3 = 42.0;\n\nvar_dump(is_int($var1)); \/\/ bool(true)\nvar_dump(is_int($var2)); \/\/ bool(false) - \u6587\u5b57\u5217\u306e\u6570\u5b57\u306f\u6574\u6570\u578b\u3067\u306f\u306a\u3044\nvar_dump(is_int($var3)); \/\/ bool(false) - \u5c0f\u6570\u70b9\u304c\u3042\u308b\u3068\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306b\u306a\u308b\n\n\/\/ is_integer() \u306f is_int() \u306e\u30a8\u30a4\u30ea\u30a2\u30b9\nvar_dump(is_integer($var1)); \/\/ bool(true)\n<\/pre>\n\n\n\n<p><strong>4. <code>is_float(mixed $var): bool<\/code> \/ <code>is_double(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002\u4e21\u95a2\u6570\u306f\u5b8c\u5168\u306b\u540c\u3058\u52d5\u4f5c\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = 3.14;\n$var2 = \"3.14\";\n$var3 = 1;\n\nvar_dump(is_float($var1)); \/\/ bool(true)\nvar_dump(is_float($var2)); \/\/ bool(false) - \u6587\u5b57\u5217\u306e\u6570\u5024\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u306f\u306a\u3044\nvar_dump(is_float($var3)); \/\/ bool(false)\n\n\/\/ \u6574\u6570\u3092\u6d6e\u52d5\u5c0f\u6570\u70b9\u3068\u3057\u3066\u8868\u73fe\u3057\u305f\u5834\u5408\n$var4 = 1.0;\nvar_dump(is_float($var4)); \/\/ bool(true)\n\n\/\/ is_double() \u306f is_float() \u306e\u30a8\u30a4\u30ea\u30a2\u30b9\nvar_dump(is_double($var1)); \/\/ bool(true)\n<\/pre>\n\n\n\n<p><strong>5. <code>is_string(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u6587\u5b57\u5217\u578b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = \"Hello\";\n$var2 = '';  \/\/ \u7a7a\u6587\u5b57\u5217\n$var3 = \"42\";\n$var4 = 42;\n\nvar_dump(is_string($var1)); \/\/ bool(true)\nvar_dump(is_string($var2)); \/\/ bool(true) - \u7a7a\u6587\u5b57\u5217\u3082\u6587\u5b57\u5217\u578b\nvar_dump(is_string($var3)); \/\/ bool(true) - \u6570\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u3082\u6587\u5b57\u5217\u578b\nvar_dump(is_string($var4)); \/\/ bool(false)\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-14\">\u8907\u5408\u30c7\u30fc\u30bf\u578b\u306e\u5224\u5b9a\u95a2\u6570<\/h4>\n\n\n\n<p><strong>6. <code>is_array(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u914d\u5217\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = [1, 2, 3];\n$var2 = [\"name\" =&gt; \"John\", \"age\" =&gt; 30];\n$var3 = \"abc\";\n$var4 = new stdClass();\n\nvar_dump(is_array($var1)); \/\/ bool(true) - \u901a\u5e38\u306e\u914d\u5217\nvar_dump(is_array($var2)); \/\/ bool(true) - \u9023\u60f3\u914d\u5217\u3082\u914d\u5217\nvar_dump(is_array($var3)); \/\/ bool(false)\nvar_dump(is_array($var4)); \/\/ bool(false) - \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u914d\u5217\u3067\u306f\u306a\u3044\n\n\/\/ \u7a7a\u306e\u914d\u5217\u3082\u914d\u5217\u3068\u3057\u3066\u5224\u5b9a\u3055\u308c\u308b\n$var5 = [];\nvar_dump(is_array($var5)); \/\/ bool(true)\n<\/pre>\n\n\n\n<p><strong>7. <code>is_object(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$var1 = new stdClass();\n$var2 = (object)[\"name\" =&gt; \"John\"];  \/\/ \u914d\u5217\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\n$var3 = \"abc\";\n$var4 = [1, 2, 3];\n\nvar_dump(is_object($var1)); \/\/ bool(true)\nvar_dump(is_object($var2)); \/\/ bool(true)\nvar_dump(is_object($var3)); \/\/ bool(false)\nvar_dump(is_object($var4)); \/\/ bool(false)\n\n\/\/ \u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\nclass Person {}\n$person = new Person();\nvar_dump(is_object($person)); \/\/ bool(true)\n<\/pre>\n\n\n\n<p><strong>8. <code>is_resource(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u30ea\u30bd\u30fc\u30b9\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002\u30ea\u30bd\u30fc\u30b9\u306f\u30d5\u30a1\u30a4\u30eb\u30cf\u30f3\u30c9\u30eb\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u306a\u3069\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d5\u30a1\u30a4\u30eb\u30ea\u30bd\u30fc\u30b9\u306e\u4f8b\n$file = fopen(\"example.txt\", \"r\");\nvar_dump(is_resource($file)); \/\/ bool(true)\n\n\/\/ \u30ea\u30bd\u30fc\u30b9\u3092\u9589\u3058\u305f\u5f8c\nfclose($file);\nvar_dump(is_resource($file)); \/\/ bool(false) - PHP 7.2\u4ee5\u524d\n\/\/ PHP 7.2\u4ee5\u964d\u3067\u306f closed resource \u306b\u306a\u308b\u304c is_resource() \u306ffalse\u3092\u8fd4\u3059\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-15\">\u7279\u6b8a\u306a\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u5224\u5b9a\u95a2\u6570<\/h4>\n\n\n\n<p><strong>9. <code>is_scalar(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u30b9\u30ab\u30e9\u30fc\u578b\uff08\u6574\u6570\u3001\u6d6e\u52d5\u5c0f\u6570\u70b9\u3001\u6587\u5b57\u5217\u3001\u8ad6\u7406\u5024\uff09\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$int = 10;\n$float = 3.14;\n$string = \"Hello\";\n$bool = true;\n$array = [1, 2, 3];\n$object = new stdClass();\n$null = NULL;\n\nvar_dump(is_scalar($int));    \/\/ bool(true)\nvar_dump(is_scalar($float));  \/\/ bool(true)\nvar_dump(is_scalar($string)); \/\/ bool(true)\nvar_dump(is_scalar($bool));   \/\/ bool(true)\nvar_dump(is_scalar($array));  \/\/ bool(false)\nvar_dump(is_scalar($object)); \/\/ bool(false)\nvar_dump(is_scalar($null));   \/\/ bool(false)\n<\/pre>\n\n\n\n<p><strong>10. <code>is_numeric(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u6570\u5024\u307e\u305f\u306f\u6570\u5024\u3068\u3057\u3066\u89e3\u91c8\u3067\u304d\u308b\u6587\u5b57\u5217\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$int = 42;\n$float = 3.14;\n$numString1 = \"42\";\n$numString2 = \"3.14\";\n$numString3 = \"0xFF\"; \/\/ 16\u9032\u6570\n$string = \"Hello\";\n$bool = true;\n\nvar_dump(is_numeric($int));       \/\/ bool(true)\nvar_dump(is_numeric($float));     \/\/ bool(true)\nvar_dump(is_numeric($numString1)); \/\/ bool(true) - \u6570\u5024\u3092\u542b\u3080\u6587\u5b57\u5217\nvar_dump(is_numeric($numString2)); \/\/ bool(true) - \u6d6e\u52d5\u5c0f\u6570\u70b9\u3092\u542b\u3080\u6587\u5b57\u5217\nvar_dump(is_numeric($numString3)); \/\/ bool(true) - 16\u9032\u6570\u3092\u542b\u3080\u6587\u5b57\u5217\nvar_dump(is_numeric($string));    \/\/ bool(false)\nvar_dump(is_numeric($bool));      \/\/ bool(false)\n<\/pre>\n\n\n\n<p><strong>11. <code>is_callable(mixed $var): bool<\/code><\/strong> \u5909\u6570\u304c\u547c\u3073\u51fa\u3057\u53ef\u80fd\uff08\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3068\u3057\u3066\u4f7f\u7528\u53ef\u80fd\uff09\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u901a\u5e38\u306e\u95a2\u6570\nfunction test_function() {\n    return \"Hello\";\n}\nvar_dump(is_callable(\"test_function\")); \/\/ bool(true)\n\n\/\/ \u7121\u540d\u95a2\u6570\n$anonymous = function() {\n    return \"World\";\n};\nvar_dump(is_callable($anonymous)); \/\/ bool(true)\n\n\/\/ \u30e1\u30bd\u30c3\u30c9\nclass TestClass {\n    public function testMethod() {\n        return \"Method\";\n    }\n    \n    public static function testStaticMethod() {\n        return \"Static Method\";\n    }\n}\n$obj = new TestClass();\nvar_dump(is_callable([$obj, \"testMethod\"])); \/\/ bool(true)\nvar_dump(is_callable([\"TestClass\", \"testStaticMethod\"])); \/\/ bool(true)\n\n\/\/ \u5b58\u5728\u3057\u306a\u3044\u95a2\u6570\nvar_dump(is_callable(\"non_existent_function\")); \/\/ bool(false)\n<\/pre>\n\n\n\n<p><strong>12. <code>is_iterable(mixed $var): bool<\/code><\/strong> (PHP 7.1\u4ee5\u964d) \u5909\u6570\u304c\u914d\u5217\u307e\u305f\u306fTraversable\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$array = [1, 2, 3];\n$object = new stdClass();\n$iterator = new ArrayIterator([1, 2, 3]);\n\nvar_dump(is_iterable($array));    \/\/ bool(true)\nvar_dump(is_iterable($object));   \/\/ bool(false)\nvar_dump(is_iterable($iterator)); \/\/ bool(true) - ArrayIterator\u306fTraversable\u3092\u5b9f\u88c5\n<\/pre>\n\n\n\n<p><strong>13. <code>is_countable(mixed $var): bool<\/code><\/strong> (PHP 7.3\u4ee5\u964d) \u5909\u6570\u304c\u914d\u5217\u307e\u305f\u306fCountable\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$array = [1, 2, 3];\n$object = new stdClass();\n$countable = new ArrayObject([1, 2, 3]); \/\/ ArrayObject\u306fCountable\u3092\u5b9f\u88c5\n\nvar_dump(is_countable($array));     \/\/ bool(true)\nvar_dump(is_countable($object));    \/\/ bool(false)\nvar_dump(is_countable($countable)); \/\/ bool(true)\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e<code>is_*()<\/code>\u7cfb\u95a2\u6570\u306f\u7279\u5b9a\u306e\u578b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306e\u306b\u6700\u9069\u5316\u3055\u308c\u3066\u304a\u308a\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u5411\u4e0a\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6539\u5584\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u4f7f\u3063\u305f\u52b9\u7387\u7684\u306a\u6761\u4ef6\u5206\u5c90\u306e\u66f8\u304d\u65b9\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-16\">is_\u7cfb\u95a2\u6570\u3092\u4f7f\u3063\u305f\u6761\u4ef6\u5206\u5c90\u306e\u66f8\u304d\u65b9\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<p><code>is_*()<\/code>\u7cfb\u95a2\u6570\u306f\u3001\u5909\u6570\u306e\u578b\u306b\u57fa\u3065\u3044\u3066\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u308b\u5834\u5408\u306b\u975e\u5e38\u306b\u4fbf\u5229\u3067\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u95a2\u6570\u3092\u4f7f\u3063\u305f\u52b9\u679c\u7684\u306a\u6761\u4ef6\u5206\u5c90\u306e\u66f8\u304d\u65b9\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-17\">\u57fa\u672c\u7684\u306a\u6761\u4ef6\u5206\u5c90\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<p>\u6700\u3082\u5358\u7d14\u306a\u4f7f\u3044\u65b9\u306f\u3001if\u6587\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306ais_\u7cfb\u95a2\u6570\u306b\u3088\u308b\u6761\u4ef6\u5206\u5c90\nfunction processValue($value) {\n    if (is_int($value)) {\n        return \"\u6574\u6570\u3067\u3059: \" . $value;\n    } elseif (is_float($value)) {\n        return \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059: \" . $value;\n    } elseif (is_string($value)) {\n        return \"\u6587\u5b57\u5217\u3067\u3059: \" . $value;\n    } elseif (is_array($value)) {\n        return \"\u914d\u5217\u3067\u3059: \" . count($value) . \"\u8981\u7d20\";\n    } elseif (is_null($value)) {\n        return \"NULL\u5024\u3067\u3059\";\n    } else {\n        return \"\u305d\u306e\u4ed6\u306e\u578b\u3067\u3059: \" . gettype($value);\n    }\n}\n\necho processValue(42);       \/\/ \"\u6574\u6570\u3067\u3059: 42\"\necho processValue(3.14);     \/\/ \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059: 3.14\"\necho processValue(\"Hello\");  \/\/ \"\u6587\u5b57\u5217\u3067\u3059: Hello\"\necho processValue([1, 2, 3]); \/\/ \"\u914d\u5217\u3067\u3059: 3\u8981\u7d20\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-18\">switch\u6587\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/h4>\n\n\n\n<p>PHP\u3067\u306fswitch\u6587\u3067\u95a2\u6570\u306e\u7d50\u679c\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001<code>gettype()<\/code>\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u65b9\u304c\u4e00\u822c\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function describeType($value) {\n    switch (gettype($value)) {\n        case 'integer':\n            return \"\u6574\u6570\u3067\u3059\";\n        case 'double':\n            return \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\";\n        case 'string':\n            return \"\u6587\u5b57\u5217\u3067\u3059\";\n        case 'array':\n            return \"\u914d\u5217\u3067\u3059\";\n        default:\n            return \"\u305d\u306e\u4ed6\u306e\u578b\u3067\u3059\";\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-19\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b91\uff1a\u578b\u30c1\u30a7\u30c3\u30af\u3068\u51e6\u7406\u3092\u5206\u96e2\u3059\u308b<\/h4>\n\n\n\n<p>\u578b\u30c1\u30a7\u30c3\u30af\u3068\u305d\u308c\u306b\u95a2\u9023\u3059\u308b\u51e6\u7406\u3092\u5225\u3005\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u5206\u96e2\u3059\u308b\u3068\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3068\u4fdd\u5b88\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class TypeProcessor {\n    \/\/ \u578b\u5225\u306e\u51e6\u7406\u30e1\u30bd\u30c3\u30c9\n    private function processInteger($value) {\n        return $value * 2;\n    }\n    \n    private function processFloat($value) {\n        return round($value, 2);\n    }\n    \n    private function processString($value) {\n        return strtoupper($value);\n    }\n    \n    private function processArray($value) {\n        return array_sum($value);\n    }\n    \n    \/\/ \u30e1\u30a4\u30f3\u306e\u51e6\u7406\u30e1\u30bd\u30c3\u30c9\n    public function process($value) {\n        if (is_int($value)) {\n            return $this-&gt;processInteger($value);\n        } elseif (is_float($value)) {\n            return $this-&gt;processFloat($value);\n        } elseif (is_string($value)) {\n            return $this-&gt;processString($value);\n        } elseif (is_array($value)) {\n            return $this-&gt;processArray($value);\n        } else {\n            throw new InvalidArgumentException(\"\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u578b\u3067\u3059: \" . gettype($value));\n        }\n    }\n}\n\n$processor = new TypeProcessor();\necho $processor-&gt;process(10);        \/\/ 20\necho $processor-&gt;process(3.14159);   \/\/ 3.14\necho $processor-&gt;process(\"hello\");   \/\/ \"HELLO\"\necho $processor-&gt;process([1, 2, 3]); \/\/ 6\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-20\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b92\uff1a\u578b\u306b\u5fdc\u3058\u305f\u95a2\u6570\u30de\u30c3\u30d7\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n\n\n\n<p>\u95a2\u6570\u30de\u30c3\u30d7\uff08\u914d\u5217\uff09\u3092\u4f7f\u7528\u3057\u3066\u578b\u306b\u57fa\u3065\u3044\u3066\u51e6\u7406\u3092\u9078\u629e\u3059\u308b\u3068\u3001if-else\u306e\u9023\u9396\u3092\u907f\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processWithFunctionMap($value) {\n    \/\/ \u578b\u306b\u5bfe\u5fdc\u3059\u308b\u51e6\u7406\u3092\u95a2\u6570\u30de\u30c3\u30d7\u3068\u3057\u3066\u5b9a\u7fa9\n    $typeHandlers = [\n        'is_int'    =&gt; function($v) { return \"\u6574\u6570\u306e2\u500d: \" . ($v * 2); },\n        'is_float'  =&gt; function($v) { return \"\u5c0f\u6570\u70b9\u4ee5\u4e0b2\u6841: \" . round($v, 2); },\n        'is_string' =&gt; function($v) { return \"\u5927\u6587\u5b57\u5909\u63db: \" . strtoupper($v); },\n        'is_array'  =&gt; function($v) { return \"\u5408\u8a08: \" . array_sum($v); },\n        'is_null'   =&gt; function($v) { return \"NULL\u5024\u3067\u3059\"; }\n    ];\n    \n    \/\/ \u8a72\u5f53\u3059\u308b\u578b\u306e\u51e6\u7406\u3092\u5b9f\u884c\n    foreach ($typeHandlers as $typeCheck =&gt; $handler) {\n        if ($typeCheck($value)) {\n            return $handler($value);\n        }\n    }\n    \n    \/\/ \u3069\u306e\u578b\u306b\u3082\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\n    return \"\u672a\u30b5\u30dd\u30fc\u30c8\u306e\u578b\u3067\u3059: \" . gettype($value);\n}\n\necho processWithFunctionMap(42);       \/\/ \"\u6574\u6570\u306e2\u500d: 84\"\necho processWithFunctionMap(3.14159);  \/\/ \"\u5c0f\u6570\u70b9\u4ee5\u4e0b2\u6841: 3.14\"\necho processWithFunctionMap(\"hello\");  \/\/ \"\u5927\u6587\u5b57\u5909\u63db: HELLO\"\necho processWithFunctionMap([1, 2, 3]); \/\/ \"\u5408\u8a08: 6\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-21\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b93\uff1a\u30bf\u30a4\u30d7\u30d2\u30f3\u30c6\u30a3\u30f3\u30b0\u3068is_\u7cfb\u95a2\u6570\u3092\u7d44\u307f\u5408\u308f\u305b\u308b<\/h4>\n\n\n\n<p>PHP 7\u4ee5\u964d\u3067\u306f\u3001\u95a2\u6570\u306e\u5f15\u6570\u306b\u30bf\u30a4\u30d7\u30d2\u30f3\u30c6\u30a3\u30f3\u30b0\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u5b9f\u884c\u6642\u306b\u8ffd\u52a0\u306e\u30c1\u30a7\u30c3\u30af\u304c\u5fc5\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30bf\u30a4\u30d7\u30d2\u30f3\u30c6\u30a3\u30f3\u30b0\u3068is_\u7cfb\u95a2\u6570\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u4f8b\nfunction processNumeric($value): string {\n    \/\/ \u57fa\u672c\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u306f\u30bf\u30a4\u30d7\u30d2\u30f3\u30c6\u30a3\u30f3\u30b0\u3067\u884c\u308f\u308c\u308b\n    \n    \/\/ \u3088\u308a\u8a73\u7d30\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092is_\u7cfb\u95a2\u6570\u3067\u884c\u3046\n    if (is_int($value)) {\n        return \"\u6574\u6570\u306e2\u500d: \" . ($value * 2);\n    } elseif (is_float($value)) {\n        return \"\u5c0f\u6570\u70b9\u4ee5\u4e0b2\u6841: \" . round($value, 2);\n    } else {\n        \/\/ \u3053\u3053\u306b\u306f\u5230\u9054\u3057\u306a\u3044\u306f\u305a\u3060\u304c\u3001\u578b\u306e\u4e92\u63db\u6027\u306e\u305f\u3081\u306b\u8ffd\u52a0\n        throw new InvalidArgumentException(\"\u6570\u5024\u578b\u304c\u5fc5\u8981\u3067\u3059\");\n    }\n}\n\n\/\/ PHP 7\u4ee5\u964d\u306e\u5171\u7528\u578b\nfunction processArrayOrCountable($collection): int {\n    if (is_array($collection)) {\n        return count($collection);\n    } elseif ($collection instanceof Countable) {\n        return count($collection);\n    } else {\n        \/\/ PHP 8\u672a\u6e80\u3067\u306f\u5171\u7528\u578b\u304c\u306a\u3044\u305f\u3081\u3001\u3053\u306e\u30c1\u30a7\u30c3\u30af\u304c\u5fc5\u8981\n        throw new InvalidArgumentException(\"\u914d\u5217\u307e\u305f\u306fCountable\u304c\u5fc5\u8981\u3067\u3059\");\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-22\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b94\uff1a\u30ac\u30fc\u30c9\u7bc0\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n\n\n\n<p>\u6761\u4ef6\u5206\u5c90\u304c\u8907\u96d1\u306b\u306a\u308b\u5834\u5408\u306f\u3001\u300c\u30ac\u30fc\u30c9\u7bc0\u300d\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u3059\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u3084\u3059\u3055\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processWithGuardClauses($value) {\n    \/\/ NULL\u5024\u306e\u5834\u5408\u306f\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\n    if (is_null($value)) {\n        return \"NULL\u5024\u3067\u3059\";\n    }\n    \n    \/\/ \u914d\u5217\u306e\u5834\u5408\u306f\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\n    if (is_array($value)) {\n        return \"\u914d\u5217\u306e\u8981\u7d20\u6570: \" . count($value);\n    }\n    \n    \/\/ \u6570\u5024\u578b\u306e\u5834\u5408\u306f\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\n    if (is_int($value) || is_float($value)) {\n        return \"\u6570\u5024\u306e2\u500d: \" . ($value * 2);\n    }\n    \n    \/\/ \u6587\u5b57\u5217\u306e\u5834\u5408\u306f\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\n    if (is_string($value)) {\n        return \"\u6587\u5b57\u5217\u306e\u9577\u3055: \" . strlen($value);\n    }\n    \n    \/\/ \u3069\u306e\u6761\u4ef6\u306b\u3082\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\n    return \"\u305d\u306e\u4ed6\u306e\u578b\u3067\u3059: \" . gettype($value);\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-23\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b95\uff1a\u8907\u5408\u6761\u4ef6\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n\n\n\n<p>\u8907\u6570\u306e\u578b\u306b\u540c\u3058\u51e6\u7406\u3092\u9069\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u8ad6\u7406\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processValue($value) {\n    \/\/ \u6570\u5024\u578b\uff08\u6574\u6570\u307e\u305f\u306f\u6d6e\u52d5\u5c0f\u6570\u70b9\uff09\u306e\u5834\u5408\n    if (is_int($value) || is_float($value)) {\n        return $value * 2;\n    }\n    \n    \/\/ \u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\u306e\u5834\u5408\n    if (is_string($value) || is_array($value)) {\n        return \"\u9577\u3055: \" . (is_string($value) ? strlen($value) : count($value));\n    }\n    \n    \/\/ \u30b9\u30ab\u30e9\u30fc\u578b\u306e\u5834\u5408\uff08\u6574\u6570\u3001\u6d6e\u52d5\u5c0f\u6570\u70b9\u3001\u6587\u5b57\u5217\u3001\u771f\u507d\u5024\uff09\n    if (is_scalar($value)) {\n        return \"\u30b9\u30ab\u30e9\u30fc\u5024\u3067\u3059: \" . $value;\n    }\n    \n    \/\/ \u305d\u306e\u4ed6\u306e\u578b\n    return \"\u975e\u30b9\u30ab\u30e9\u30fc\u578b\u3067\u3059\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-24\">\u3088\u304f\u3042\u308b\u9593\u9055\u3044\u3068\u56de\u907f\u65b9\u6cd5<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u578b\u5909\u63db\u306b\u983c\u308a\u3059\u304e\u308b<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\nfunction isPositive($value) {\n    return $value &gt; 0; \/\/ \u81ea\u52d5\u578b\u5909\u63db\u306b\u983c\u3063\u3066\u3044\u308b\n}\n\n\/\/ \u826f\u3044\u4f8b\nfunction isPositive($value) {\n    return is_numeric($value) &amp;&amp; $value &gt; 0;\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u306a\u6bd4\u8f03\u3092\u4f7f\u7528\u3057\u306a\u3044<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\nif (gettype($value) == 'string') { \/* ... *\/ }\n\n\/\/ \u826f\u3044\u4f8b\nif (gettype($value) === 'string') { \/* ... *\/ }\n\/\/ \u307e\u305f\u306f\u3001\u3088\u308a\u76f4\u63a5\u7684\u306b\nif (is_string($value)) { \/* ... *\/ }\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u578b\u30c1\u30a7\u30c3\u30af\u306e\u9806\u5e8f\u304c\u975e\u52b9\u7387<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u983b\u5ea6\u306e\u4f4e\u3044\u578b\u304b\u3089\u5148\u306b\u30c1\u30a7\u30c3\u30af\uff09\nif (is_resource($value)) { \/* ... *\/ }\nelseif (is_object($value)) { \/* ... *\/ }\nelseif (is_array($value)) { \/* ... *\/ }\nelseif (is_string($value)) { \/* ... *\/ } \/\/ \u6700\u3082\u983b\u7e41\u306b\u767a\u751f\u3059\u308b\u578b\n\n\/\/ \u826f\u3044\u4f8b\uff08\u983b\u5ea6\u306e\u9ad8\u3044\u578b\u304b\u3089\u5148\u306b\u30c1\u30a7\u30c3\u30af\uff09\nif (is_string($value)) { \/* ... *\/ }\nelseif (is_array($value)) { \/* ... *\/ }\nelseif (is_object($value)) { \/* ... *\/ }\nelseif (is_resource($value)) { \/* ... *\/ }\n<\/pre>\n\n\n\n<p><code>is_*()<\/code>\u7cfb\u95a2\u6570\u3092\u4f7f\u3063\u305f\u52b9\u7387\u7684\u306a\u6761\u4ef6\u5206\u5c90\u3092\u884c\u3046\u3053\u3068\u3067\u3001PHP\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u3001\u4e88\u671f\u3057\u306a\u3044\u578b\u5909\u63db\u306b\u3088\u308b\u30d0\u30b0\u3092\u9632\u3050\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3084\u5916\u90e8\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u306b\u306f\u3001\u9069\u5207\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-25\">var_dump\u95a2\u6570\u3067\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u540c\u6642\u306b\u78ba\u8a8d\u3059\u308b<\/h2>\n\n\n\n<p>PHP\u3067\u306f\u3001<code>gettype()<\/code>\u3084<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3067\u5909\u6570\u306e\u578b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u304c\u3001\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u540c\u6642\u306b\u8a73\u7d30\u306b\u8abf\u3079\u305f\u3044\u5834\u5408\u306b\u306f\u3001<code>var_dump()<\/code>\u95a2\u6570\u304c\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>var_dump()<\/code>\u95a2\u6570\u306f\u3001\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u4eba\u9593\u304c\u8aad\u3081\u308b\u5f62\u5f0f\u3067\u51fa\u529b\u3059\u308b\u95a2\u6570\u3067\u3001\u7279\u306b\u30c7\u30d0\u30c3\u30b0\u4f5c\u696d\u6642\u306b\u91cd\u5b9d\u3057\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u306f\u3001\u5358\u4e00\u306e\u5909\u6570\u3060\u3051\u3067\u306a\u304f\u3001\u8907\u96d1\u306a\u69cb\u9020\u3092\u6301\u3064\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u5bb9\u3082\u518d\u5e30\u7684\u306b\u8868\u793a\u3067\u304d\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u628a\u63e1\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u57fa\u672c\u7684\u306a\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u69cb\u6587\nvoid var_dump(mixed $expression [, mixed $... ])\n\n\/\/ \u4f7f\u7528\u4f8b\nvar_dump($variable);\n\n\/\/ \u8907\u6570\u306e\u5909\u6570\u3092\u4e00\u5ea6\u306b\u8868\u793a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\nvar_dump($var1, $var2, $var3);\n<\/pre>\n\n\n\n<p><code>var_dump()<\/code>\u306e\u7279\u5fb4\u306f\u3001\u4ee5\u4e0b\u306e\u70b9\u306b\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8868\u793a\u3059\u308b<\/strong> \u2013 \u5909\u6570\u306e\u578b\u3068\u5b9f\u969b\u306e\u5024\u306e\u4e21\u65b9\u3092\u8868\u793a\u3057\u307e\u3059<\/li>\n\n\n\n<li><strong>\u8907\u6570\u306e\u5909\u6570\u3092\u4e00\u5ea6\u306b\u8868\u793a\u3067\u304d\u308b<\/strong> \u2013 \u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u8907\u6570\u306e\u5909\u6570\u3092\u6e21\u305b\u307e\u3059<\/li>\n\n\n\n<li><strong>\u30cd\u30b9\u30c8\u3055\u308c\u305f\u69cb\u9020\u3082\u518d\u5e30\u7684\u306b\u8868\u793a\u3059\u308b<\/strong> \u2013 \u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5185\u90e8\u69cb\u9020\u3082\u8a73\u7d30\u306b\u8868\u793a\u3057\u307e\u3059<\/li>\n\n\n\n<li><strong>\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3082\u8ffd\u8de1\u3059\u308b<\/strong> \u2013 \u540c\u3058\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u8907\u6570\u306e\u53c2\u7167\u3082\u9069\u5207\u306b\u8868\u793a\u3057\u307e\u3059<\/li>\n\n\n\n<li><strong>\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3082\u8868\u793a\u3059\u308b<\/strong> \u2013 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3082\u8868\u793a\u3055\u308c\u307e\u3059<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u69d8\u3005\u306a\u578b\u306e\u5909\u6570\u306b\u5bfe\u3059\u308b<code>var_dump()<\/code>\u306e\u51fa\u529b\u3092\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u57fa\u672c\u7684\u306a\u30c7\u30fc\u30bf\u578b\n$integer = 42;\n$float = 3.14159;\n$string = \"Hello, PHP!\";\n$boolean = true;\n$null = NULL;\n\nvar_dump($integer, $float, $string, $boolean, $null);\n\n\/* \u51fa\u529b\u4f8b:\nint(42)\nfloat(3.14159)\nstring(11) \"Hello, PHP!\"\nbool(true)\nNULL\n*\/\n\n\/\/ \u914d\u5217\n$array = [1, 2, \"three\", [4, 5]];\nvar_dump($array);\n\n\/* \u51fa\u529b\u4f8b:\narray(4) {\n  [0]=&gt;\n  int(1)\n  [1]=&gt;\n  int(2)\n  [2]=&gt;\n  string(5) \"three\"\n  [3]=&gt;\n  array(2) {\n    [0]=&gt;\n    int(4)\n    [1]=&gt;\n    int(5)\n  }\n}\n*\/\n\n\/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\nclass Person {\n    public $name = \"John\";\n    private $age = 30;\n    protected $email = \"john@example.com\";\n}\n\n$person = new Person();\nvar_dump($person);\n\n\/* \u51fa\u529b\u4f8b:\nobject(Person)#1 (3) {\n  [\"name\"]=&gt;\n  string(4) \"John\"\n  [\"age\":\"Person\":private]=&gt;\n  int(30)\n  [\"email\":protected]=&gt;\n  string(16) \"john@example.com\"\n}\n*\/\n<\/pre>\n\n\n\n<p><code>var_dump()<\/code>\u306f\u3001\u7279\u306b\u8907\u96d1\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u30c7\u30d0\u30c3\u30b0\u3084\u30b3\u30fc\u30c9\u306e\u52d5\u4f5c\u78ba\u8a8d\u6642\u306b\u975e\u5e38\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001<code>var_dump()<\/code>\u3092\u52b9\u679c\u7684\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3068\u3001\u8907\u96d1\u306a\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u628a\u63e1\u306b\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-26\">\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u5a01\u529b\u3092\u767a\u63ee\u3059\u308bvar_dump\u306e\u4f7f\u3044\u65b9<\/h3>\n\n\n\n<p><code>var_dump()<\/code>\u95a2\u6570\u306f\u3001PHP\u306e\u30c7\u30d0\u30c3\u30b0\u4f5c\u696d\u306b\u304a\u3044\u3066\u6700\u3082\u983b\u7e41\u306b\u4f7f\u7528\u3055\u308c\u308b\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3059\u3002\u305d\u306e\u7406\u7531\u306f\u3001\u5909\u6570\u306e\u578b\u3068\u5024\u3092\u7d30\u90e8\u307e\u3067\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u6a5f\u80fd\u306b\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u6642\u306b<code>var_dump()<\/code>\u3092\u52b9\u679c\u7684\u306b\u6d3b\u7528\u3059\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-27\">\u57fa\u672c\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u30c6\u30af\u30cb\u30c3\u30af<\/h4>\n\n\n\n<p>\u5358\u7d14\u306a\u5909\u6570\u306e\u30c7\u30d0\u30c3\u30b0\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5909\u6570\u306e\u5024\u3092\u30c7\u30d0\u30c3\u30b0\n$username = \"john_doe\";\n$age = 30;\n$isActive = true;\n\n\/\/ \u8907\u6570\u306e\u5909\u6570\u3092\u4e00\u5ea6\u306b\u78ba\u8a8d\nvar_dump($username, $age, $isActive);\n\n\/\/ \u8a08\u7b97\u7d50\u679c\u3092\u30c7\u30d0\u30c3\u30b0\n$result = calculateTotal($price, $quantity);\nvar_dump($result);\n\n\/\/ \u6761\u4ef6\u5f0f\u306e\u8a55\u4fa1\u7d50\u679c\u3092\u30c7\u30d0\u30c3\u30b0\n$condition = ($age &gt;= 18 &amp;&amp; $isActive);\nvar_dump($condition); \/\/ \u6761\u4ef6\u304c\u771f\u304b\u507d\u304b\u3092\u78ba\u8a8d\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-28\">\u51fa\u529b\u3092\u898b\u3084\u3059\u304f\u3059\u308b<\/h4>\n\n\n\n<p>HTML\u30da\u30fc\u30b8\u3067\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u5834\u5408\u3001<code>var_dump()<\/code>\u306e\u51fa\u529b\u304c\u8aad\u307f\u306b\u304f\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u51fa\u529b\u3092\u6539\u5584\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u6539\u884c\u3068\u30b9\u30da\u30fc\u30b9\u3092\u4fdd\u6301\u3059\u308b\u305f\u3081\u306bpre\u30bf\u30b0\u3067\u56f2\u3080\necho '&lt;pre&gt;';\nvar_dump($complexArray);\necho '&lt;\/pre&gt;';\n\n\/\/ \u307e\u305f\u306f\u3001\u3088\u304f\u4f7f\u3046\u5834\u5408\u306f\u95a2\u6570\u5316\u3059\u308b\nfunction debug($var, $exit = false) {\n    echo '&lt;pre&gt;';\n    var_dump($var);\n    echo '&lt;\/pre&gt;';\n    if ($exit) exit;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ndebug($user);\ndebug($response, true); \/\/ \u30c7\u30d0\u30c3\u30b0\u5f8c\u306b\u51e6\u7406\u3092\u7d42\u4e86\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-29\">var_dump\u3068\u305d\u306e\u4ed6\u306e\u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u306e\u9055\u3044<\/h4>\n\n\n\n<p>PHP\u306b\u306f<code>var_dump()<\/code>\u4ee5\u5916\u306b\u3082<code>print_r()<\/code>\u3084<code>var_export()<\/code>\u306a\u3069\u306e\u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u7279\u5fb4\u3092\u7406\u89e3\u3057\u3066\u9069\u5207\u306b\u4f7f\u3044\u5206\u3051\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n<div id=\"id-2307aff3-c42a-43f3-a529-06e88622ba82\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u95a2\u6570<\/th><th>\u7279\u5fb4<\/th><th>\u7528\u9014<\/th><\/tr><\/thead><tbody><tr><td><code>var_dump()<\/code><\/td><td>\u578b\u60c5\u5831\u3068\u5024\u3092\u8a73\u7d30\u306b\u8868\u793a\u3002NULL\u5024\u3082\u660e\u793a\u7684\u306b\u8868\u793a<\/td><td>\u8a73\u7d30\u306a\u30c7\u30d0\u30c3\u30b0<\/td><\/tr><tr><td><code>print_r()<\/code><\/td><td>\u5024\u306e\u307f\u3092\u4eba\u9593\u304c\u8aad\u307f\u3084\u3059\u3044\u5f62\u5f0f\u3067\u8868\u793a\u3002\u578b\u60c5\u5831\u306a\u3057<\/td><td>\u30b7\u30f3\u30d7\u30eb\u306a\u69cb\u9020\u8868\u793a<\/td><\/tr><tr><td><code>var_export()<\/code><\/td><td>\u6709\u52b9\u306aPHP\u30b3\u30fc\u30c9\u3068\u3057\u3066\u51fa\u529b\u3002\u518d\u5229\u7528\u53ef\u80fd<\/td><td>\u30b3\u30fc\u30c9\u751f\u6210\u3084\u6c38\u7d9a\u5316<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$array = ['name' =&gt; 'John', 'age' =&gt; 30, 'active' =&gt; true];\n\n\/\/ var_dump \u306e\u51fa\u529b\u4f8b\nvar_dump($array);\n\/* \u51fa\u529b:\narray(3) {\n  [\"name\"]=&gt;\n  string(4) \"John\"\n  [\"age\"]=&gt;\n  int(30)\n  [\"active\"]=&gt;\n  bool(true)\n}\n*\/\n\n\/\/ print_r \u306e\u51fa\u529b\u4f8b\nprint_r($array);\n\/* \u51fa\u529b:\nArray\n(\n    [name] =&gt; John\n    [age] =&gt; 30\n    [active] =&gt; 1\n)\n*\/\n\n\/\/ var_export \u306e\u51fa\u529b\u4f8b\nvar_export($array);\n\/* \u51fa\u529b:\narray (\n  'name' =&gt; 'John',\n  'age' =&gt; 30,\n  'active' =&gt; true,\n)\n*\/\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-30\">\u5b9f\u8df5\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u30b7\u30ca\u30ea\u30aa<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u95a2\u6570\u306e\u5165\u51fa\u529b\u3092\u30c7\u30d0\u30c3\u30b0<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processUserData($userData) {\n    echo '&lt;pre&gt;Input: ';\n    var_dump($userData);\n    echo '&lt;\/pre&gt;';\n    \n    \/\/ \u51e6\u7406\u3092\u5b9f\u884c\n    $result = doSomethingWith($userData);\n    \n    echo '&lt;pre&gt;Output: ';\n    var_dump($result);\n    echo '&lt;\/pre&gt;';\n    \n    return $result;\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u6761\u4ef6\u5206\u5c90\u306e\u30c7\u30d0\u30c3\u30b0<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if ($condition) {\n    echo 'Condition is true: ';\n    var_dump($condition);\n    \/\/ \u6761\u4ef6\u304c\u771f\u306e\u5834\u5408\u306e\u51e6\u7406\n} else {\n    echo 'Condition is false: ';\n    var_dump($condition);\n    \/\/ \u6761\u4ef6\u304c\u507d\u306e\u5834\u5408\u306e\u51e6\u7406\n}\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u30eb\u30fc\u30d7\u306e\u30c7\u30d0\u30c3\u30b0<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">foreach ($items as $key =&gt; $value) {\n    echo \"Iteration $key: \";\n    var_dump($value);\n    \n    \/\/ \u7279\u5b9a\u306e\u6761\u4ef6\u3067\u8a73\u7d30\u306a\u30c7\u30d0\u30c3\u30b0\u3092\u884c\u3046\n    if ($value-&gt;hasError()) {\n        echo \"Error details: \";\n        var_dump($value-&gt;getError());\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-31\">\u30c7\u30d0\u30c3\u30b0\u51fa\u529b\u306e\u5236\u5fa1<\/h4>\n\n\n\n<p>\u672c\u756a\u74b0\u5883\u3067\u306f\u3001\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u76f4\u63a5\u8868\u793a\u305b\u305a\u306b\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u3053\u3068\u304c\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u30ed\u30b0\u306b\u8a18\u9332\nob_start();\nvar_dump($variable);\n$output = ob_get_clean();\nerror_log($output);\n\n\/\/ \u958b\u767a\u74b0\u5883\u3067\u306e\u307f\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\nfunction debug($var) {\n    if (ENVIRONMENT === 'development') {\n        echo '&lt;pre&gt;';\n        var_dump($var);\n        echo '&lt;\/pre&gt;';\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-32\">\u30c7\u30d0\u30c3\u30b0\u4e2d\u306e\u51e6\u7406\u306e\u4e00\u6642\u505c\u6b62<\/h4>\n\n\n\n<p>\u7279\u306b\u8907\u96d1\u306a\u30c7\u30d0\u30c3\u30b0\u3067\u306f\u3001\u51e6\u7406\u3092\u4e00\u6642\u505c\u6b62\u3057\u3066\u5909\u6570\u306e\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function debugAndDie($var, $message = 'Debug stop point') {\n    echo '&lt;h3&gt;' . $message . '&lt;\/h3&gt;';\n    echo '&lt;pre&gt;';\n    var_dump($var);\n    echo '&lt;\/pre&gt;';\n    die('==== Debug End ====');\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nif ($unexpectedCondition) {\n    debugAndDie($problematicVariable, '\u4e88\u671f\u3057\u306a\u3044\u6761\u4ef6\u304c\u767a\u751f\u3057\u307e\u3057\u305f');\n}\n<\/pre>\n\n\n\n<p><code>var_dump()<\/code>\u306f\u30b7\u30f3\u30d7\u30eb\u306a\u304c\u3089\u5f37\u529b\u306a\u30c7\u30d0\u30c3\u30b0\u30c4\u30fc\u30eb\u3067\u3059\u3002\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30d0\u30b0\u306e\u539f\u56e0\u3092\u7d20\u65e9\u304f\u7279\u5b9a\u3057\u3001\u30b3\u30fc\u30c9\u306e\u52d5\u4f5c\u3092\u7406\u89e3\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u7279\u306b\u578b\u95a2\u9023\u306e\u554f\u984c\u3092\u8abf\u67fb\u3059\u308b\u969b\u306b\u306f\u3001\u578b\u60c5\u5831\u3082\u540c\u6642\u306b\u8868\u793a\u3059\u308b<code>var_dump()<\/code>\u306e\u7279\u6027\u304c\u975e\u5e38\u306b\u6709\u7528\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-33\">\u8907\u96d1\u306a\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u628a\u63e1\u306bvar_dump\u3092\u6d3b\u7528\u3059\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p>PHP\u306e\u958b\u767a\u3067\u306f\u3001\u591a\u6b21\u5143\u914d\u5217\u3084\u8907\u96d1\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u3092\u6271\u3046\u3053\u3068\u304c\u983b\u7e41\u306b\u3042\u308a\u307e\u3059\u3002\u7279\u306bAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u7d50\u679c\u3001\u3042\u308b\u3044\u306f\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u306a\u3069\u306f\u3001\u305d\u306e\u69cb\u9020\u3092\u628a\u63e1\u3059\u308b\u306e\u304c\u96e3\u3057\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<code>var_dump()<\/code>\u95a2\u6570\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u8907\u96d1\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u8996\u899a\u7684\u306b\u7406\u89e3\u3059\u308b\u306e\u306b\u975e\u5e38\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-34\">\u591a\u6b21\u5143\u914d\u5217\u306e\u69cb\u9020\u628a\u63e1<\/h4>\n\n\n\n<p>\u591a\u6b21\u5143\u914d\u5217\u306e\u69cb\u9020\u3092\u52b9\u7387\u7684\u306b\u628a\u63e1\u3059\u308b\u305f\u3081\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u591a\u6b21\u5143\u914d\u5217\u306e\u4f8b\uff08\u4f8b\uff1aJSON\u304b\u3089\u5909\u63db\u3055\u308c\u305f\u30c7\u30fc\u30bf\uff09\n$userData = [\n    'user' =&gt; [\n        'id' =&gt; 1234,\n        'name' =&gt; 'John Doe',\n        'email' =&gt; 'john@example.com',\n        'preferences' =&gt; [\n            'theme' =&gt; 'dark',\n            'notifications' =&gt; [\n                'email' =&gt; true,\n                'push' =&gt; false,\n                'sms' =&gt; true\n            ]\n        ],\n    ],\n    'permissions' =&gt; [\n        'admin' =&gt; false,\n        'modules' =&gt; ['dashboard', 'reports', 'users']\n    ],\n    'activity' =&gt; [\n        ['type' =&gt; 'login', 'date' =&gt; '2023-01-15', 'ip' =&gt; '192.168.1.1'],\n        ['type' =&gt; 'edit', 'date' =&gt; '2023-01-16', 'details' =&gt; ['module' =&gt; 'users', 'action' =&gt; 'update']]\n    ]\n];\n\n\/\/ \u57fa\u672c\u7684\u306a\u8868\u793a\u65b9\u6cd5\necho '&lt;pre&gt;';\nvar_dump($userData);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u591a\u6b21\u5143\u914d\u5217\u3067\u306f\u3001\u7279\u5b9a\u306e\u30d1\u30b9\u306b\u3042\u308b\u5024\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306b\u3001\u5168\u4f53\u3092<code>var_dump()<\/code>\u3059\u308b\u3068\u60c5\u5831\u91cf\u304c\u591a\u3059\u304e\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3093\u306a\u6642\u306f\u7279\u5b9a\u306e\u90e8\u5206\u306e\u307f\u3092\u8868\u793a\u3059\u308b\u3068\u52b9\u7387\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7279\u5b9a\u306e\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u307f\u3092\u78ba\u8a8d\necho '&lt;pre&gt;\u30e6\u30fc\u30b6\u30fc\u901a\u77e5\u8a2d\u5b9a: ';\nvar_dump($userData['user']['preferences']['notifications']);\necho '&lt;\/pre&gt;';\n\n\/\/ \u7279\u5b9a\u306e\u914d\u5217\u8981\u7d20\u306e\u307f\u3092\u78ba\u8a8d\necho '&lt;pre&gt;\u6700\u65b0\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3: ';\nvar_dump($userData['activity'][count($userData['activity']) - 1]);\necho '&lt;\/pre&gt;';\n\n\/\/ \u914d\u5217\u306e\u69cb\u9020\u306e\u307f\u3092\u628a\u63e1\u3057\u305f\u3044\u5834\u5408\uff08\u5024\u306e\u8a73\u7d30\u306f\u4e0d\u8981\u306a\u5834\u5408\uff09\nfunction array_structure($array, $level = 0) {\n    foreach ($array as $key =&gt; $value) {\n        echo str_repeat('  ', $level) . \"[$key] =&gt; \";\n        if (is_array($value)) {\n            echo \"Array\\n\";\n            array_structure($value, $level + 1);\n        } else {\n            echo gettype($value) . \"\\n\";\n        }\n    }\n}\n\necho '&lt;pre&gt;';\narray_structure($userData);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-35\">\u8907\u96d1\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u306e\u89e3\u6790<\/h4>\n\n\n\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5834\u5408\u306f\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u53ef\u8996\u6027\uff08public, private, protected\uff09\u3084\u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3001\u3088\u308a\u8907\u96d1\u306a\u60c5\u5831\u304c\u542b\u307e\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u96d1\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u968e\u5c64\u306e\u4f8b\nclass Address {\n    public $street;\n    public $city;\n    private $zipCode;\n    \n    public function __construct($street, $city, $zipCode) {\n        $this-&gt;street = $street;\n        $this-&gt;city = $city;\n        $this-&gt;zipCode = $zipCode;\n    }\n}\n\nclass User {\n    public $name;\n    protected $email;\n    private $password;\n    public $address;\n    \n    public function __construct($name, $email, $password, Address $address) {\n        $this-&gt;name = $name;\n        $this-&gt;email = $email;\n        $this-&gt;password = $password;\n        $this-&gt;address = $address;\n    }\n}\n\n$address = new Address('123 Main St', 'New York', '10001');\n$user = new User('Jane Doe', 'jane@example.com', 'secret123', $address);\n\n\/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u69cb\u9020\u306e\u8868\u793a\necho '&lt;pre&gt;';\nvar_dump($user);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<p><code>var_dump()<\/code>\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u3084\u30d7\u30ed\u30c6\u30af\u30c6\u30c3\u30c9\u30d7\u30ed\u30d1\u30c6\u30a3\u3082\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u304c\u3001\u968e\u5c64\u304c\u8907\u96d1\u306b\u306a\u308b\u3068\u898b\u3065\u3089\u304f\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u304c\u5f79\u7acb\u3061\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Reflection API\u3092\u4f7f\u7528\u3057\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8a73\u7d30\u60c5\u5831\u3092\u53d6\u5f97\nfunction inspect_object($object) {\n    $reflection = new ReflectionClass($object);\n    \n    echo \"Class: \" . $reflection-&gt;getName() . \"\\n\";\n    \n    \/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4e00\u89a7\u8868\u793a\n    echo \"\\nProperties:\\n\";\n    $properties = $reflection-&gt;getProperties();\n    foreach ($properties as $property) {\n        $property-&gt;setAccessible(true);\n        $value = $property-&gt;getValue($object);\n        $visibility = $property-&gt;isPublic() ? 'public' : ($property-&gt;isProtected() ? 'protected' : 'private');\n        \n        echo \"- $visibility {$property-&gt;getName()}: \";\n        if (is_object($value)) {\n            echo \"Object of class \" . get_class($value) . \"\\n\";\n        } elseif (is_array($value)) {\n            echo \"Array with \" . count($value) . \" elements\\n\";\n        } else {\n            echo gettype($value) . \" (\" . (is_string($value) ? \"\\\"$value\\\"\" : $value) . \")\\n\";\n        }\n    }\n    \n    \/\/ \u30e1\u30bd\u30c3\u30c9\u306e\u4e00\u89a7\u8868\u793a\n    echo \"\\nMethods:\\n\";\n    $methods = $reflection-&gt;getMethods();\n    foreach ($methods as $method) {\n        $visibility = $method-&gt;isPublic() ? 'public' : ($method-&gt;isProtected() ? 'protected' : 'private');\n        echo \"- $visibility {$method-&gt;getName()}()\\n\";\n    }\n}\n\necho '&lt;pre&gt;';\ninspect_object($user);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-36\">\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u52b9\u679c\u7684\u306a\u30c7\u30d0\u30c3\u30b0<\/h4>\n\n\n\n<p>\u975e\u5e38\u306b\u5927\u304d\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u5834\u5408\u3001\u5168\u4f53\u3092<code>var_dump()<\/code>\u3059\u308b\u3068\u51e6\u7406\u304c\u91cd\u304f\u306a\u3063\u305f\u308a\u3001\u8868\u793a\u304c\u5d29\u308c\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u3088\u3046\u306a\u5834\u5408\u306b\u306f\u4ee5\u4e0b\u306e\u65b9\u6cd5\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ 1. \u51fa\u529b\u3092\u5236\u9650\u3059\u308b\nfunction limited_var_dump($var, $max_depth = 3, $current_depth = 0) {\n    if ($current_depth &gt;= $max_depth) {\n        echo \"... (max depth reached)\\n\";\n        return;\n    }\n    \n    if (is_array($var)) {\n        echo \"array(\" . count($var) . \") {\\n\";\n        $indent = str_repeat(\"  \", $current_depth + 1);\n        foreach ($var as $key =&gt; $value) {\n            echo $indent . \"[\" . $key . \"] =&gt; \";\n            limited_var_dump($value, $max_depth, $current_depth + 1);\n        }\n        echo str_repeat(\"  \", $current_depth) . \"}\\n\";\n    } elseif (is_object($var)) {\n        echo \"object(\" . get_class($var) . \") {\\n\";\n        \/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8868\u793a\uff08\u7c21\u7565\u5316\u306e\u305f\u3081\u7701\u7565\uff09\n        echo str_repeat(\"  \", $current_depth) . \"}\\n\";\n    } else {\n        var_dump($var);\n    }\n}\n\n\/\/ 2. \u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3059\u308b\uff08\u914d\u5217\u306e\u4e00\u90e8\u306e\u307f\u3092\u8868\u793a\uff09\nfunction sample_var_dump($array, $sample_size = 3) {\n    if (!is_array($array)) {\n        var_dump($array);\n        return;\n    }\n    \n    $count = count($array);\n    echo \"array($count) { \/\/ Showing $sample_size samples\\n\";\n    \n    \/\/ \u5148\u982d\u306e\u8981\u7d20\n    $keys = array_keys($array);\n    for ($i = 0; $i &lt; min($sample_size, $count); $i++) {\n        $key = $keys[$i];\n        echo \"  [$key] =&gt; \";\n        var_dump($array[$key]);\n    }\n    \n    \/\/ \u672b\u5c3e\u306e\u8981\u7d20\uff08\u5341\u5206\u306a\u8981\u7d20\u304c\u3042\u308b\u5834\u5408\uff09\n    if ($count &gt; $sample_size * 2) {\n        echo \"  \/\/ ... \" . ($count - $sample_size * 2) . \" items skipped ...\\n\";\n        \n        for ($i = max(0, $count - $sample_size); $i &lt; $count; $i++) {\n            $key = $keys[$i];\n            echo \"  [$key] =&gt; \";\n            var_dump($array[$key]);\n        }\n    }\n    \n    echo \"}\";\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$largeArray = array_fill(0, 1000, 'data');\necho '&lt;pre&gt;';\nsample_var_dump($largeArray, 5);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-37\">\u5b9f\u969b\u306e\u5fdc\u7528\u4f8b\uff1aAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u89e3\u6790<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306e\u958b\u767a\u3067\u306f\u3001JSON\u30c7\u30fc\u30bf\u3092<code>json_decode()<\/code>\u3057\u3066\u304b\u3089<code>var_dump()<\/code>\u3067\u69cb\u9020\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3044\u3046\u30b7\u30ca\u30ea\u30aa\u304c\u3088\u304f\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u4f8b\n$jsonResponse = '{\"status\":\"success\",\"data\":{\"users\":[{\"id\":1,\"name\":\"Alice\"},{\"id\":2,\"name\":\"Bob\"}],\"total\":2},\"meta\":{\"page\":1,\"limit\":10}}';\n\n\/\/ JSON\u30c7\u30b3\u30fc\u30c9\n$response = json_decode($jsonResponse, true); \/\/ \u9023\u60f3\u914d\u5217\u3068\u3057\u3066\u53d6\u5f97\n\n\/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u5168\u4f53\u306e\u69cb\u9020\u3092\u78ba\u8a8d\necho '&lt;pre&gt;\u5168\u4f53\u69cb\u9020:';\nvar_dump($response);\necho '&lt;\/pre&gt;';\n\n\/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306e\u78ba\u8a8d\necho '&lt;pre&gt;\u30b9\u30c6\u30fc\u30bf\u30b9:';\nvar_dump($response['status']);\necho '&lt;\/pre&gt;';\n\n\/\/ \u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u78ba\u8a8d\necho '&lt;pre&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7:';\nvar_dump($response['data']['users']);\necho '&lt;\/pre&gt;';\n\n\/\/ \u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u78ba\u8a8d\necho '&lt;pre&gt;\u6700\u521d\u306e\u30e6\u30fc\u30b6\u30fc:';\nvar_dump($response['data']['users'][0]);\necho '&lt;\/pre&gt;';\n<\/pre>\n\n\n\n<p><code>var_dump()<\/code>\u95a2\u6570\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u8907\u96d1\u306a\u30c7\u30fc\u30bf\u69cb\u9020\u3092\u89e3\u6790\u3059\u308b\u969b\u306b\u975e\u5e38\u306b\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3068\u306a\u308a\u307e\u3059\u3002\u7279\u306b\u578b\u60c5\u5831\u3082\u540c\u6642\u306b\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u4e88\u671f\u3057\u306a\u3044\u578b\u5909\u63db\u3084\u578b\u306e\u4e0d\u4e00\u81f4\u3092\u767a\u898b\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u898f\u6a21\u3084\u8907\u96d1\u3055\u306b\u5fdc\u3058\u3066\u3001\u5168\u4f53\u3092\u8868\u793a\u3059\u308b\u304b\u4e00\u90e8\u3060\u3051\u3092\u8868\u793a\u3059\u308b\u304b\u3092\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u52b9\u7387\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-38\">PHP 7\u4ee5\u964d\u306e\u53b3\u683c\u306a\u578b\u5ba3\u8a00\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b<\/h2>\n\n\n\n<p>PHP 7\u304b\u3089\u578b\u30b7\u30b9\u30c6\u30e0\u304c\u5927\u5e45\u306b\u5f37\u5316\u3055\u308c\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u3053\u308c\u307e\u3067\u898b\u3066\u304d\u305f<code>gettype()<\/code>\u3084<code>is_*()<\/code>\u95a2\u6570\u3001<code>var_dump()<\/code>\u306a\u3069\u306f\u5b9f\u884c\u6642\u306b\u578b\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u3067\u3057\u305f\u304c\u3001PHP 7\u4ee5\u964d\u3067\u306f\u300c\u578b\u5ba3\u8a00\u300d\u3068\u3044\u3046\u5f62\u3067\u3001\u30b3\u30fc\u30c9\u306e\u8a18\u8ff0\u6bb5\u968e\u304b\u3089\u578b\u3092\u660e\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u578b\u5ba3\u8a00\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u5411\u4e0a<\/strong> \u2013 \u95a2\u6570\u306e\u5f15\u6570\u3084\u623b\u308a\u5024\u306e\u578b\u304c\u660e\u78ba\u306b\u306a\u308a\u307e\u3059<\/li>\n\n\n\n<li><strong>\u65e9\u671f\u30a8\u30e9\u30fc\u691c\u51fa<\/strong> \u2013 \u578b\u306e\u4e0d\u4e00\u81f4\u306f\u5b9f\u884c\u6642\u306b\u30a8\u30e9\u30fc\u3068\u306a\u308b\u305f\u3081\u3001\u30d0\u30b0\u306e\u65e9\u671f\u767a\u898b\u306b\u3064\u306a\u304c\u308a\u307e\u3059<\/li>\n\n\n\n<li><strong>IDE\u306e\u30b5\u30dd\u30fc\u30c8\u5411\u4e0a<\/strong> \u2013 \u578b\u5ba3\u8a00\u304c\u3042\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u88dc\u5b8c\u3084\u9759\u7684\u89e3\u6790\u304c\u52b9\u679c\u7684\u306b\u6a5f\u80fd\u3057\u307e\u3059<\/li>\n\n\n\n<li><strong>\u81ea\u5df1\u6587\u66f8\u5316<\/strong> \u2013 \u30b3\u30fc\u30c9\u304c\u81ea\u8eab\u306e\u610f\u56f3\u3092\u660e\u78ba\u306b\u4f1d\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/li>\n\n\n\n<li><strong>\u4fdd\u5b88\u6027\u306e\u5411\u4e0a<\/strong> \u2013 \u5c06\u6765\u306e\u30b3\u30fc\u30c9\u5909\u66f4\u6642\u306b\u578b\u306e\u4e0d\u4e00\u81f4\u3092\u9632\u304e\u3084\u3059\u304f\u306a\u308a\u307e\u3059<\/li>\n<\/ol>\n\n\n\n<p>PHP 7\u3067\u5c0e\u5165\u3055\u308c\u3001PHP 7.1\u4ee5\u964d\u3067\u62e1\u5f35\u3055\u308c\u305f\u578b\u5ba3\u8a00\u6a5f\u80fd\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-39\">\u5229\u7528\u53ef\u80fd\u306a\u578b\u5ba3\u8a00\u306e\u7a2e\u985e<\/h3>\n\n\n\n<p>PHP 7\u4ee5\u964d\u3067\u4f7f\u7528\u3067\u304d\u308b\u578b\u5ba3\u8a00\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n<div id=\"id-976a09fc-c82e-4955-85b5-b0e464270911\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>PHP \u30d0\u30fc\u30b8\u30e7\u30f3<\/th><th>\u5229\u7528\u53ef\u80fd\u306a\u578b\u5ba3\u8a00<\/th><\/tr><\/thead><tbody><tr><td>PHP 7.0<\/td><td>int, float, bool, string, array, callable, \u30af\u30e9\u30b9\u540d, \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u540d, self<\/td><\/tr><tr><td>PHP 7.1<\/td><td>\u4e0a\u8a18\u306b\u52a0\u3048\u3066\uff1aiterable, void\uff08\u623b\u308a\u5024\u306e\u307f\uff09<\/td><\/tr><tr><td>PHP 7.2<\/td><td>\u4e0a\u8a18\u306b\u52a0\u3048\u3066\uff1aobject<\/td><\/tr><tr><td>PHP 8.0<\/td><td>\u4e0a\u8a18\u306b\u52a0\u3048\u3066\uff1amixed, union types (<code>int|string<\/code>), static\uff08\u623b\u308a\u5024\u306e\u307f\uff09, false\uff08\u5171\u7528\u578b\u306e\u4e00\u90e8\u3068\u3057\u3066\uff09<\/td><\/tr><tr><td>PHP 8.1<\/td><td>\u4e0a\u8a18\u306b\u52a0\u3048\u3066\uff1anever\uff08\u623b\u308a\u5024\u306e\u307f\uff09, intersection types, readonly properties<\/td><\/tr><tr><td>PHP 8.2<\/td><td>\u4e0a\u8a18\u306b\u52a0\u3048\u3066\uff1anull, false, true\uff08\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u578b\u3068\u3057\u3066\uff09, readonly classes<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"i-40\">\u57fa\u672c\u7684\u306a\u578b\u5ba3\u8a00\u306e\u4f7f\u3044\u65b9<\/h3>\n\n\n\n<p>PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u306f\u3001\u95a2\u6570\u306e\u5f15\u6570\u3068\u623b\u308a\u5024\u306b\u5bfe\u3057\u3066\u6307\u5b9a\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u306e\u4f8b\nfunction addNumbers(int $a, int $b): int {\n    return $a + $b;\n}\n\n\/\/ \u5f15\u6570\u306b\u7570\u306a\u308b\u578b\u3092\u6e21\u3059\u3068TypeError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\ntry {\n    echo addNumbers(5, \"10\"); \/\/ \u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3067\u306f\u52d5\u4f5c\u3059\u308b\u304c\u3001\u53b3\u683c\u30e2\u30fc\u30c9\u3067\u306f\u30a8\u30e9\u30fc\n} catch (TypeError $e) {\n    echo \"\u578b\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage();\n}\n<\/pre>\n\n\n\n<p>\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u5ba3\u8a00\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30af\u30e9\u30b9\u306e\u578b\u5ba3\u8a00\nclass User {\n    public int $id;\n    public string $name;\n    \n    public function __construct(int $id, string $name) {\n        $this-&gt;id = $id;\n        $this-&gt;name = $name;\n    }\n}\n\n\/\/ \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u578b\u306e\u5ba3\u8a00\ninterface Printable {\n    public function printData(): string;\n}\n\nclass UserReport implements Printable {\n    private User $user;\n    \n    public function __construct(User $user) {\n        $this-&gt;user = $user;\n    }\n    \n    public function printData(): string {\n        return \"User ID: {$this-&gt;user-&gt;id}, Name: {$this-&gt;user-&gt;name}\";\n    }\n}\n\nfunction generateReport(Printable $report): string {\n    return $report-&gt;printData();\n}\n\n$user = new User(1, \"John\");\n$report = new UserReport($user);\necho generateReport($report); \/\/ \"User ID: 1, Name: John\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-41\">PHP 8\u306e\u5171\u7528\u578b\uff08Union Types\uff09<\/h3>\n\n\n\n<p>PHP 8\u304b\u3089\u306f\u8907\u6570\u306e\u578b\u3092\u8a31\u5bb9\u3059\u308b\u300c\u5171\u7528\u578b\uff08Union Types\uff09\u300d\u3082\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 8\u306e\u5171\u7528\u578b\uff08Union Types\uff09\nfunction process(int|string $value): int|float {\n    if (is_string($value)) {\n        return strlen($value);\n    }\n    return $value * 2.5;\n}\n\necho process(10);    \/\/ 25.0\necho process(\"Hello\"); \/\/ 5\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-42\">null\u8a31\u5bb9\u578b\u3068\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/h3>\n\n\n\n<p>\u5f15\u6570\u304cnull\u3092\u8a31\u5bb9\u3059\u308b\u5834\u5408\u306f\u3001PHP 8\u4ee5\u964d\u3067\u306f\u5171\u7528\u578b\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u308c\u4ee5\u524d\u3067\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u304c\u4e00\u822c\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 7\u3067\u306enull\u8a31\u5bb9\u578b\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u4f7f\u7528\uff09\nfunction greet(?string $name = null): string {\n    if ($name === null) {\n        return \"Hello, Guest!\";\n    }\n    return \"Hello, $name!\";\n}\n\n\/\/ PHP 8\u3067\u306enull\u8a31\u5bb9\u578b\uff08\u5171\u7528\u578b\u3092\u4f7f\u7528\uff09\nfunction welcome(null|string $name): string {\n    if ($name === null) {\n        return \"Welcome, Guest!\";\n    }\n    return \"Welcome, $name!\";\n}\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u578b\u5ba3\u8a00\u6a5f\u80fd\u306f\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u3001\u591a\u304f\u306e\u30d0\u30b0\u3092\u672a\u7136\u306b\u9632\u3050\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u6b21\u306e\u7bc0\u3067\u306f\u3001\u3088\u308a\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e<code>declare(strict_types=1)<\/code>\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-43\">declare(strict_types=1)\u3067\u578b\u306e\u53b3\u683c\u3055\u3092\u9ad8\u3081\u308b\u65b9\u6cd5<\/h3>\n\n\n\n<p>PHP 7\u3067\u578b\u5ba3\u8a00\u304c\u5f37\u5316\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u300c\u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u300d\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u3001PHP\u306e\u5f93\u6765\u306e\u67d4\u8edf\u306a\u578b\u5909\u63db\u3092\u7dad\u6301\u3059\u308b\u305f\u3081\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u3088\u308a\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u305f\u3081\u306b\u306f\u3001<code>declare(strict_types=1)<\/code>\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3057\u3066\u300c\u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u300d\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-44\">strict_types\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3068\u306f<\/h4>\n\n\n\n<p><code>declare(strict_types=1)<\/code>\u306f\u3001PHP\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306e\u53b3\u683c\u3055\u3092\u6307\u5b9a\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067\u3059\u3002\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u578b\u5ba3\u8a00\u306b\u5bfe\u3057\u3066\u81ea\u52d5\u7684\u306a\u578b\u5909\u63db\u304c\u884c\u308f\u308c\u306a\u304f\u306a\u308a\u3001\u578b\u306e\u4e0d\u4e00\u81f4\u304c\u3042\u3063\u305f\u5834\u5408\u306b<code>TypeError<\/code>\u4f8b\u5916\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ strict_types\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u5ba3\u8a00\u65b9\u6cd5\n\/\/ \u3053\u308c\u306f\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\uff08PHP\u30bf\u30b0\u306e\u76f4\u5f8c\uff09\u306b\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\n&lt;?php\ndeclare(strict_types=1);\n\n\/\/ \u4ee5\u964d\u306e\u30b3\u30fc\u30c9\u306f\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u306e\u5bfe\u8c61\u3068\u306a\u308a\u307e\u3059\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-45\">\u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3068\u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u306e\u9055\u3044<\/h4>\n\n\n\n<p>\u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09\u3068\u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u306e\u4e3b\u306a\u9055\u3044\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\uff08strict_types\u306a\u3057\uff09\n&lt;?php\n\/\/ declare(strict_types=1); \u304c\u306a\u3044\u5834\u5408\n\nfunction add(int $a, int $b): int {\n    return $a + $b;\n}\n\n\/\/ \u6587\u5b57\u5217\u304c\u81ea\u52d5\u7684\u306b\u6574\u6570\u306b\u5909\u63db\u3055\u308c\u308b\necho add(\"5\", \"10\"); \/\/ \u51fa\u529b: 15\necho add(\"5.5\", \"10.7\"); \/\/ \u51fa\u529b: 15\uff08\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306f\u5207\u308a\u6368\u3066\uff09\n\n\/\/ \u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\n&lt;?php\ndeclare(strict_types=1);\n\nfunction add(int $a, int $b): int {\n    return $a + $b;\n}\n\n\/\/ \u578b\u304c\u4e00\u81f4\u3057\u306a\u3044\u3068TypeError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\necho add(\"5\", \"10\"); \/\/ TypeError: add(): Argument #1 ($a) must be of type int, string given\necho add(\"5.5\", \"10.7\"); \/\/ \u5b9f\u884c\u3055\u308c\u306a\u3044\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3067\u306f\u3001\u5f15\u6570\u306e\u578b\u304c\u5ba3\u8a00\u3055\u308c\u305f\u578b\u3068\u6b63\u78ba\u306b\u4e00\u81f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u81ea\u52d5\u7684\u306a\u578b\u5909\u63db\u306f\u884c\u308f\u308c\u305a\u3001\u578b\u304c\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306b\u306f\u4f8b\u5916\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-46\">strict_types\u306e\u5f71\u97ff\u7bc4\u56f2<\/h4>\n\n\n\n<p><code>strict_types<\/code>\u306e\u5ba3\u8a00\u306f\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u95a2\u6570\u547c\u3073\u51fa\u3057\u306b\u306e\u307f\u5f71\u97ff\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u975e\u5e38\u306b\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><code>strict_types=1<\/code>\u3092\u5ba3\u8a00\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u5834\u5408\u3001\u305d\u306e\u547c\u3073\u51fa\u3057\u306f\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u306e\u5bfe\u8c61\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>strict_types=1<\/code>\u3092\u5ba3\u8a00\u3057\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u3001<code>strict_types=1<\/code>\u3092\u5ba3\u8a00\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u5834\u5408\u3001\u305d\u306e\u547c\u3073\u51fa\u3057\u306f\u5f31\u3044\u578b\u30c1\u30a7\u30c3\u30af\u306e\u5bfe\u8c61\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u306e\u6319\u52d5\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ functions.php - \u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u30d5\u30a1\u30a4\u30eb\n&lt;?php\n\/\/ \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u306fstrict_types\u5ba3\u8a00\u306f\u3057\u3066\u3044\u306a\u3044\n\nfunction multiply(int $a, int $b): int {\n    return $a * $b;\n}\n\n\/\/ strict_caller.php - \u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3067\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u30d5\u30a1\u30a4\u30eb\n&lt;?php\ndeclare(strict_types=1);\nrequire_once 'functions.php';\n\n\/\/ \u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u9069\u7528\u3055\u308c\u308b\necho multiply(5, 10); \/\/ \u51fa\u529b: 50\necho multiply(\"5\", \"10\"); \/\/ TypeError: multiply(): Argument #1 ($a) must be of type int, string given\n\n\/\/ weak_caller.php - \u5f31\u3044\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3067\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u30d5\u30a1\u30a4\u30eb\n&lt;?php\n\/\/ strict_types\u5ba3\u8a00\u306f\u3057\u3066\u3044\u306a\u3044\nrequire_once 'functions.php';\n\n\/\/ \u5f31\u3044\u578b\u30c1\u30a7\u30c3\u30af\u304c\u9069\u7528\u3055\u308c\u308b\uff08\u81ea\u52d5\u578b\u5909\u63db\u304c\u884c\u308f\u308c\u308b\uff09\necho multiply(5, 10); \/\/ \u51fa\u529b: 50\necho multiply(\"5\", \"10\"); \/\/ \u51fa\u529b: 50\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-47\">strict_types\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30ea\u30c3\u30c8<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d0\u30b0\u306e\u65e9\u671f\u767a\u898b<\/strong>\uff1a\u578b\u306e\u4e0d\u4e00\u81f4\u306b\u3088\u308b\u554f\u984c\u3092\u5b9f\u884c\u6642\u306b\u5373\u5ea7\u306b\u691c\u51fa\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u610f\u56f3\u3057\u306a\u3044\u52d5\u4f5c\u306e\u9632\u6b62<\/strong>\uff1a\u81ea\u52d5\u578b\u5909\u63db\u306b\u3088\u308b\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3092\u9632\u304e\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u306e\u660e\u78ba\u5316<\/strong>\uff1a\u578b\u306e\u53b3\u683c\u3055\u306b\u3088\u308a\u3001\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u3088\u308a\u660e\u78ba\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u54c1\u8cea\u306e\u5411\u4e0a<\/strong>\uff1a\u578b\u306b\u95a2\u3059\u308b\u898f\u5f8b\u304c\u5f37\u5316\u3055\u308c\u3001\u5168\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u54c1\u8cea\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3068\u306e\u89aa\u548c\u6027<\/strong>\uff1aPHPStan\u3084Psalm\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3068\u306e\u76f8\u6027\u304c\u826f\u304f\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-48\">strict_types\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d5\u30a1\u30a4\u30eb\u5358\u4f4d\u306e\u8a2d\u5b9a<\/strong>\uff1a<code>strict_types<\/code>\u306f\u30d5\u30a1\u30a4\u30eb\u5358\u4f4d\u3067\u9069\u7528\u3055\u308c\u308b\u305f\u3081\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5ba3\u8a00\u4f4d\u7f6e<\/strong>\uff1a<code>declare(strict_types=1);<\/code>\u306f\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\uff08PHP\u30bf\u30b0\u306e\u76f4\u5f8c\uff09\u306b\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u4e92\u63db\u6027<\/strong>\uff1a\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u306e\u4e92\u63db\u6027\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u4e00\u90e8\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u5f31\u3044\u578b\u4ed8\u3051\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u660e\u793a\u7684\u306a\u578b\u5909\u63db<\/strong>\uff1a\u53b3\u683c\u306a\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u3067\u306f\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u660e\u793a\u7684\u306a\u578b\u5909\u63db\uff08\u30ad\u30e3\u30b9\u30c8\uff09\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\ndeclare(strict_types=1);\n\nfunction add(int $a, int $b): int {\n    return $a + $b;\n}\n\n\/\/ \u660e\u793a\u7684\u306a\u578b\u5909\u63db\u3092\u884c\u3046\u4f8b\n$num1 = \"5\"; \/\/ \u6587\u5b57\u5217\n$num2 = \"10\"; \/\/ \u6587\u5b57\u5217\n\n\/\/ \u660e\u793a\u7684\u306b\u6574\u6570\u306b\u5909\u63db\u3057\u3066\u304b\u3089\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\necho add((int)$num1, (int)$num2); \/\/ \u51fa\u529b: 15\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-49\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u5e38\u306b\u4f7f\u7528\u3059\u308b<\/strong>\uff1a\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u958b\u59cb\u3059\u308b\u969b\u306f\u3001\u6700\u521d\u304b\u3089<code>strict_types=1<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u3066\u4f7f\u7528\u3059\u308b<\/strong>\uff1a\u6df7\u5728\u3055\u305b\u308b\u3068\u30d0\u30b0\u306e\u539f\u56e0\u306b\u306a\u308b\u305f\u3081\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u3067\u4e00\u8cab\u3057\u3066\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>PHPDoc\u3068\u306e\u4f75\u7528<\/strong>\uff1a\u578b\u5ba3\u8a00\u306b\u52a0\u3048\u3066PHPDoc\u30b3\u30e1\u30f3\u30c8\u3082\u4f7f\u7528\u3059\u308b\u3068\u3001IDE\u306e\u30b5\u30dd\u30fc\u30c8\u304c\u3055\u3089\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5b9f\u88c5<\/strong>\uff1a<code>TypeError<\/code>\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3057\u3066\u9069\u5207\u306b\u51e6\u7406\u3059\u308b\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\ndeclare(strict_types=1);\n\n\/**\n * 2\u3064\u306e\u6574\u6570\u3092\u52a0\u7b97\u3059\u308b\n * \n * @param int $a \u6700\u521d\u306e\u6570\u5024\n * @param int $b 2\u756a\u76ee\u306e\u6570\u5024\n * @return int \u52a0\u7b97\u7d50\u679c\n *\/\nfunction add(int $a, int $b): int {\n    return $a + $b;\n}\n\n\/\/ \u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u4f8b\ntry {\n    $result = add(5, \"10\");\n    echo $result;\n} catch (TypeError $e) {\n    echo \"\u578b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: \" . $e-&gt;getMessage();\n    \/\/ \u30a8\u30e9\u30fc\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u306a\u3069\u306e\u51e6\u7406\n}\n<\/pre>\n\n\n\n<p><code>declare(strict_types=1)<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u3092\u3088\u308a\u5f37\u529b\u306b\u6d3b\u7528\u3057\u3001\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u5927\u898f\u6a21\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u8907\u6570\u306e\u958b\u767a\u8005\u304c\u95a2\u308f\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u3053\u306e\u6a5f\u80fd\u3092\u7a4d\u6975\u7684\u306b\u63a1\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-50\">\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u306b\u3088\u308b\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u5411\u4e0a\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u578b\u5ba3\u8a00\u306f\u5358\u306b\u30a8\u30e9\u30fc\u3092\u65e9\u671f\u306b\u691c\u51fa\u3059\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u5168\u4f53\u306e\u54c1\u8cea\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u306e\u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3057\u3066\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-51\">\u5f15\u6570\u306e\u578b\u5ba3\u8a00\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<p><strong>1. \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u512a\u5148\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u5b9f\u88c5\u30af\u30e9\u30b9\u3067\u306f\u306a\u304f\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u578b\u3068\u3057\u3066\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u67d4\u8edf\u6027\u304c\u9ad8\u307e\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u306b\u4f9d\u5b58\uff09\nfunction processRepository(UserRepository $repository) {\n    \/\/ \u51e6\u7406\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u4f9d\u5b58\uff09\nfunction processRepository(RepositoryInterface $repository) {\n    \/\/ \u51e6\u7406\n}\n<\/pre>\n\n\n\n<p><strong>2. \u30b9\u30ab\u30e9\u30fc\u578b\u306e\u9069\u5207\u306a\u9078\u629e<\/strong><\/p>\n\n\n\n<p>\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u76ee\u7684\u306b\u6700\u9069\u306a\u578b\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u578b\u304c\u5e83\u3059\u304e\u308b\uff09\nfunction calculateAge($birthYear): int {\n    return date('Y') - $birthYear;\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u9069\u5207\u306a\u578b\u3092\u4f7f\u7528\uff09\nfunction calculateAge(int $birthYear): int {\n    return date('Y') - $birthYear;\n}\n<\/pre>\n\n\n\n<p><strong>3. \u5f15\u6570\u30ea\u30b9\u30c8\u306e\u578b\u306e\u4e00\u8cab\u6027<\/strong><\/p>\n\n\n\n<p>\u95a2\u9023\u3059\u308b\u8907\u6570\u306e\u5f15\u6570\u304c\u3042\u308b\u5834\u5408\u3001\u578b\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u3053\u3068\u3067\u30b3\u30fc\u30c9\u304c\u8aad\u307f\u3084\u3059\u304f\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u578b\u304c\u4e00\u8cab\u3057\u3066\u3044\u306a\u3044\uff09\nfunction createRectangle($width, int $height): array {\n    return ['width' =&gt; $width, 'height' =&gt; $height];\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u578b\u304c\u4e00\u8cab\u3057\u3066\u3044\u308b\uff09\nfunction createRectangle(int $width, int $height): array {\n    return ['width' =&gt; $width, 'height' =&gt; $height];\n}\n<\/pre>\n\n\n\n<p><strong>4. null\u8a31\u5bb9\u578b\u306e\u9069\u5207\u306a\u4f7f\u7528<\/strong><\/p>\n\n\n\n<p>null\u5024\u3092\u8a31\u5bb9\u3059\u308b\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u306f\u3001PHP 7.1\u4ee5\u964d\u3067<code>?<\/code>\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 7.1\u4ee5\u964d\u306e\u69cb\u6587\nfunction greet(?string $name): string {\n    if ($name === null) {\n        return \"Hello, Guest!\";\n    }\n    return \"Hello, {$name}!\";\n}\n\n\/\/ PHP 8\u306e\u5171\u7528\u578b\u69cb\u6587\nfunction greet(null|string $name): string {\n    \/\/ \u540c\u69d8\u306e\u5b9f\u88c5\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-52\">\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<p><strong>1. \u3067\u304d\u308b\u3060\u3051\u5177\u4f53\u7684\u306a\u578b\u3092\u4f7f\u7528\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u623b\u308a\u5024\u306e\u578b\u306f\u3001\u53ef\u80fd\u306a\u9650\u308a\u5177\u4f53\u7684\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08mixed\u3092\u4f7f\u7528\uff09\nfunction getData($id) {\n    \/\/ ...\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u5177\u4f53\u7684\u306a\u578b\u3092\u6307\u5b9a\uff09\nfunction getUserData(int $id): ?User {\n    \/\/ ...\n}\n<\/pre>\n\n\n\n<p><strong>2. void\u578b\u306e\u6d3b\u7528<\/strong><\/p>\n\n\n\n<p>\u4f55\u3082\u8fd4\u3055\u306a\u3044\u95a2\u6570\u306b\u306f<code>void<\/code>\u578b\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 7.1\u4ee5\u964d\nfunction logMessage(string $message): void {\n    error_log($message);\n    \/\/ return\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u306a\u3044\u304b\u3001\u5358\u306breturn\u306e\u307f\n}\n<\/pre>\n\n\n\n<p><strong>3. never\u578b\u306e\u6d3b\u7528<\/strong> (PHP 8.1\u4ee5\u964d)<\/p>\n\n\n\n<p>\u4f8b\u5916\u3092\u30b9\u30ed\u30fc\u3059\u308b\u3060\u3051\u3067\u6c7a\u3057\u3066\u5024\u3092\u8fd4\u3055\u306a\u3044\u95a2\u6570\u306b\u306f<code>never<\/code>\u578b\u3092\u4f7f\u7528\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 8.1\u4ee5\u964d\nfunction throwError(string $message): never {\n    throw new RuntimeException($message);\n}\n<\/pre>\n\n\n\n<p><strong>4. \u623b\u308a\u5024\u306e\u578b\u306e\u4e00\u8cab\u6027<\/strong><\/p>\n\n\n\n<p>\u540c\u69d8\u306e\u76ee\u7684\u3092\u6301\u3064\u95a2\u6570\u9593\u3067\u306f\u623b\u308a\u5024\u306e\u578b\u306e\u4e00\u8cab\u6027\u3092\u4fdd\u3064\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u623b\u308a\u5024\u306e\u578b\u304c\u4e00\u8cab\u3057\u3066\u3044\u306a\u3044\uff09\nfunction findUserById(int $id): ?User {\n    \/\/ ...\n}\nfunction findUserByEmail(string $email) { \/\/ \u578b\u5ba3\u8a00\u306a\u3057\n    \/\/ ...\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u623b\u308a\u5024\u306e\u578b\u304c\u4e00\u8cab\u3057\u3066\u3044\u308b\uff09\nfunction findUserById(int $id): ?User {\n    \/\/ ...\n}\nfunction findUserByEmail(string $email): ?User {\n    \/\/ ...\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-53\">\u8907\u5408\u578b\u5ba3\u8a00\u306e\u30c6\u30af\u30cb\u30c3\u30af (PHP 8\u4ee5\u964d)<\/h4>\n\n\n\n<p>PHP 8\u3067\u5c0e\u5165\u3055\u308c\u305f\u5171\u7528\u578b\uff08Union Types\uff09\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u6b63\u78ba\u306a\u578b\u5236\u7d04\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u6570\u306e\u578b\u3092\u8a31\u5bb9\u3059\u308b\u5f15\u6570\nfunction process(array|string $data): int|float {\n    if (is_array($data)) {\n        return count($data);\n    }\n    return strlen($data);\n}\n\n\/\/ NULL\u8a31\u5bb9\u3068\u5171\u7528\u578b\u306e\u7d44\u307f\u5408\u308f\u305b\nfunction findRecord(int $id): null|User|Customer {\n    \/\/ \u30e6\u30fc\u30b6\u30fc\u307e\u305f\u306f\u9867\u5ba2\u3001\u307e\u305f\u306fNULL\u3092\u8fd4\u3059\n}\n<\/pre>\n\n\n\n<p>PHP 8.1\u304b\u3089\u306f\u4ea4\u5dee\u578b\uff08Intersection Types\uff09\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u8907\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\nfunction process(Countable&amp;Traversable $collection): int {\n    $count = 0;\n    foreach ($collection as $item) {\n        $count++;\n    }\n    return $count;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-54\">\u578b\u5ba3\u8a00\u3092\u4f7f\u3063\u305f\u8a2d\u8a08\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<p><strong>1. \u30d5\u30a1\u30af\u30c8\u30ea\u30e1\u30bd\u30c3\u30c9\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n\n\n\n<p>\u623b\u308a\u5024\u306e\u578b\u3068\u3057\u3066\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u5b9f\u88c5\u306e\u8a73\u7d30\u3092\u96a0\u853d\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface PaymentGateway {\n    public function processPayment(float $amount): bool;\n}\n\nclass PayPalGateway implements PaymentGateway {\n    public function processPayment(float $amount): bool {\n        \/\/ PayPal\u56fa\u6709\u306e\u5b9f\u88c5\n    }\n}\n\nclass StripeGateway implements PaymentGateway {\n    public function processPayment(float $amount): bool {\n        \/\/ Stripe\u56fa\u6709\u306e\u5b9f\u88c5\n    }\n}\n\nclass PaymentGatewayFactory {\n    public static function create(string $type): PaymentGateway {\n        return match ($type) {\n            'paypal' =&gt; new PayPalGateway(),\n            'stripe' =&gt; new StripeGateway(),\n            default =&gt; throw new InvalidArgumentException(\"Unsupported gateway: $type\"),\n        };\n    }\n}\n<\/pre>\n\n\n\n<p><strong>2. \u5024\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n\n\n\n<p>\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u4ee3\u308f\u308a\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u610f\u5473\u306e\u3042\u308b\u578b\u5236\u7d04\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Email {\n    private string $value;\n    \n    public function __construct(string $email) {\n        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n            throw new InvalidArgumentException(\"Invalid email: $email\");\n        }\n        $this-&gt;value = $email;\n    }\n    \n    public function getValue(): string {\n        return $this-&gt;value;\n    }\n}\n\nclass User {\n    public function __construct(\n        private string $name,\n        private Email $email \/\/ Email\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u578b\u3068\u3057\u3066\u4f7f\u7528\n    ) {}\n    \n    public function getEmail(): Email {\n        return $this-&gt;email;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\nfunction sendWelcomeEmail(Email $email): void {\n    \/\/ email\u304cvalid\u3067\u3042\u308b\u3053\u3068\u304c\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u308b\n}\n<\/pre>\n\n\n\n<p><strong>3. \u30af\u30e9\u30b9\u5b9a\u6570\u3092\u4f7f\u3063\u305f\u7591\u4f3c\u5217\u6319\u578b<\/strong> (PHP 8.1\u3088\u308a\u524d)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class UserStatus {\n    public const ACTIVE = 'active';\n    public const INACTIVE = 'inactive';\n    public const BANNED = 'banned';\n    \n    private string $status;\n    \n    public function __construct(string $status) {\n        if (!in_array($status, [self::ACTIVE, self::INACTIVE, self::BANNED])) {\n            throw new InvalidArgumentException(\"Invalid status: $status\");\n        }\n        $this-&gt;status = $status;\n    }\n    \n    public function getStatus(): string {\n        return $this-&gt;status;\n    }\n}\n\nfunction activateUser(User $user, string $status): void {\n    \/\/ \u4efb\u610f\u306e\u6587\u5b57\u5217\u3067\u306f\u306a\u304f\u3001\u6709\u52b9\u306a\u30b9\u30c6\u30fc\u30bf\u30b9\u306e\u307f\u53d7\u3051\u5165\u308c\u308b\n    $userStatus = new UserStatus($status);\n    \/\/ ...\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-55\">\u5b9f\u8df5\u7684\u306a\u30d2\u30f3\u30c8<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>PHPDoc\u3068\u578b\u5ba3\u8a00\u306e\u4f75\u7528<\/strong>\uff1a\u578b\u5ba3\u8a00\u306b\u52a0\u3048\u3066PHPDoc\u30b3\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u8a73\u7d30\u306a\u578b\u60c5\u5831\u3092\u63d0\u4f9b\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u30e6\u30fc\u30b6\u30fc\u3092\u691c\u7d22\u3059\u308b\n *\n * @param int $id \u30e6\u30fc\u30b6\u30fcID\n * @return User|null \u30e6\u30fc\u30b6\u30fc\u304c\u898b\u3064\u304b\u3063\u305f\u5834\u5408\u306fUser\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306fnull\n *\/\nfunction findUser(int $id): ?User {\n    \/\/ \u5b9f\u88c5\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u306e\u6d3b\u7528<\/strong>\uff1aPHPStan\u3084Psalm\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u578b\u95a2\u9023\u306e\u554f\u984c\u3092\u65e9\u671f\u306b\u691c\u51fa\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u578b\u30d2\u30f3\u30c8<\/strong>\uff1a\u914d\u5217\u5185\u306e\u8981\u7d20\u306e\u578b\u3092PHPDoc\u3067\u660e\u793a\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * @param User[] $users \u30e6\u30fc\u30b6\u30fc\u306e\u914d\u5217\n * @return string[] \u30e6\u30fc\u30b6\u30fc\u540d\u306e\u914d\u5217\n *\/\nfunction extractUserNames(array $users): array {\n    return array_map(fn(User $user) =&gt; $user-&gt;getName(), $users);\n}\n<\/pre>\n\n\n\n<p>\u578b\u5ba3\u8a00\u3092\u9069\u5207\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308a\u3001\u30d0\u30b0\u306e\u65e9\u671f\u767a\u898b\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002\u7279\u306b\u30c1\u30fc\u30e0\u3067\u958b\u767a\u3059\u308b\u5834\u5408\u3084\u3001\u9577\u671f\u7684\u306a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u304c\u5fc5\u8981\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u578b\u5ba3\u8a00\u306b\u3088\u308b\u30b3\u30fc\u30c9\u54c1\u8cea\u306e\u5411\u4e0a\u304c\u5927\u304d\u306a\u4fa1\u5024\u3092\u3082\u305f\u3089\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-56\">instanceof\u6f14\u7b97\u5b50\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u3092\u5224\u5b9a\u3059\u308b<\/h2>\n\n\n\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3044\u3066\u3001\u5909\u6570\u304c\u3069\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u304b\u3092\u5224\u5b9a\u3059\u308b\u3053\u3068\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002PHP\u3067\u306f\u3001<code>instanceof<\/code>\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u3092\u5224\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u6f14\u7b97\u5b50\u306f\u3001<code>gettype()<\/code>\u95a2\u6570\u3084<code>is_object()<\/code>\u95a2\u6570\u3088\u308a\u3082\u8a73\u7d30\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u53ef\u80fd\u3067\u3001\u30af\u30e9\u30b9\u968e\u5c64\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9f\u88c5\u95a2\u4fc2\u306a\u3069\u3082\u8003\u616e\u3057\u305f\u5224\u5b9a\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u4ee5\u4e0b\u306e\u69cb\u6587\u3067\u4f7f\u7528\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ instanceof\u6f14\u7b97\u5b50\u306e\u57fa\u672c\u69cb\u6587\nobject instanceof class_name\n<\/pre>\n\n\n\n<p>\u3053\u306e\u6f14\u7b97\u5b50\u306f\u3001\u5de6\u8fba\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u53f3\u8fba\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u5834\u5408\u306b<code>true<\/code>\u3092\u8fd4\u3057\u3001\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u306b<code>false<\/code>\u3092\u8fd4\u3057\u307e\u3059\u3002\u53f3\u8fba\u306b\u306f\u3001\u30af\u30e9\u30b9\u540d\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u540d\u3001\u307e\u305f\u306f<code>self<\/code>\u3001<code>parent<\/code>\u3001<code>static<\/code>\u306a\u3069\u306e\u7279\u6b8a\u306a\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-57\">\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h3>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306e\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Animal {}\nclass Dog extends Animal {}\nclass Cat extends Animal {}\n\n$dog = new Dog();\n\nvar_dump($dog instanceof Dog);     \/\/ bool(true) - $dog\u306fDog\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\nvar_dump($dog instanceof Animal);  \/\/ bool(true) - $dog\u306fAnimal\u3092\u7d99\u627f\u3057\u3066\u3044\u308b\nvar_dump($dog instanceof Cat);     \/\/ bool(false) - $dog\u306fCat\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u306a\u3044\nvar_dump($dog instanceof stdClass); \/\/ bool(false) - $dog\u306fstdClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u306a\u3044\n\n\/\/ \u5909\u6570\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306fis_object()\u3092\u4f7f\u7528\nvar_dump(is_object($dog));  \/\/ bool(true)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-58\">instanceof \u3068 is_object() \u306e\u9055\u3044<\/h3>\n\n\n\n<p><code>instanceof<\/code>\u3068<code>is_object()<\/code>\u306e\u4e3b\u306a\u9055\u3044\u306f\u3001<code>is_object()<\/code>\u304c\u5358\u306b\u305d\u306e\u5909\u6570\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306e\u306b\u5bfe\u3057\u3001<code>instanceof<\/code>\u306f\u3069\u306e\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u70b9\u306b\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$obj = new stdClass();\n$str = \"Hello\";\n$num = 42;\n\n\/\/ is_object()\u306f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\nvar_dump(is_object($obj));  \/\/ bool(true)\nvar_dump(is_object($str));  \/\/ bool(false)\nvar_dump(is_object($num));  \/\/ bool(false)\n\n\/\/ instanceof\u306f\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\nvar_dump($obj instanceof stdClass);  \/\/ bool(true)\nvar_dump($obj instanceof DateTime);  \/\/ bool(false)\n\n\/\/ \u975e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306binstanceof\u3092\u4f7f\u7528\u3059\u308b\u3068PHP 7.3\u4ee5\u524d\u3067\u306fE_NOTICE\u304c\u767a\u751f\n\/\/ PHP 8.0\u4ee5\u964d\u3067\u306f\u8b66\u544a\u306a\u3057\u3067false\u3092\u8fd4\u3059\nvar_dump($str instanceof stdClass);  \/\/ bool(false)\nvar_dump($num instanceof stdClass);  \/\/ bool(false)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-59\">\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u30c8\u30ec\u30a4\u30c8\u306e\u5224\u5b9a<\/h3>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9f\u88c5\u30c1\u30a7\u30c3\u30af\u306b\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface Printable {\n    public function printData();\n}\n\nclass Report implements Printable {\n    public function printData() {\n        echo \"\u30ec\u30dd\u30fc\u30c8\u30c7\u30fc\u30bf\";\n    }\n}\n\nclass Chart implements Printable {\n    public function printData() {\n        echo \"\u30c1\u30e3\u30fc\u30c8\u30c7\u30fc\u30bf\";\n    }\n}\n\nclass User {\n    public $name;\n}\n\n$report = new Report();\n$chart = new Chart();\n$user = new User();\n\nvar_dump($report instanceof Printable);  \/\/ bool(true)\nvar_dump($chart instanceof Printable);   \/\/ bool(true)\nvar_dump($user instanceof Printable);    \/\/ bool(false)\n\n\/\/ \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u306b\u5fdc\u3058\u305f\u51e6\u7406\nfunction printDocument($doc) {\n    if ($doc instanceof Printable) {\n        $doc-&gt;printData();\n    } else {\n        echo \"\u5370\u5237\u3067\u304d\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\";\n    }\n}\n\nprintDocument($report);  \/\/ \"\u30ec\u30dd\u30fc\u30c8\u30c7\u30fc\u30bf\"\nprintDocument($user);    \/\/ \"\u5370\u5237\u3067\u304d\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\"\n<\/pre>\n\n\n\n<p>\u30c8\u30ec\u30a4\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3082<code>instanceof<\/code>\u3067\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\u304c\u3001\u5c11\u3057\u52d5\u4f5c\u304c\u7570\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">trait Loggable {\n    public function log($message) {\n        echo \"\u30ed\u30b0: $message\";\n    }\n}\n\nclass Service {\n    use Loggable;\n}\n\n$service = new Service();\n\n\/\/ \u30c8\u30ec\u30a4\u30c8\u305d\u306e\u3082\u306e\u3092instanceof\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\n\/\/ var_dump($service instanceof Loggable);  \/\/ Fatal error\n\n\/\/ \u30c8\u30ec\u30a4\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\nvar_dump($service instanceof Service);   \/\/ bool(true)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-60\">\u30af\u30e9\u30b9\u968e\u5c64\u3067\u306einstanceof\u306e\u6319\u52d5<\/h3>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u30af\u30e9\u30b9\u306e\u7d99\u627f\u95a2\u4fc2\u3092\u8003\u616e\u3057\u305f\u5224\u5b9a\u3092\u884c\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7d99\u627f\u3092\u4f7f\u3063\u305f\u30af\u30e9\u30b9\u968e\u5c64\nclass Vehicle {\n    protected $brand;\n    \n    public function __construct($brand) {\n        $this-&gt;brand = $brand;\n    }\n}\n\nclass Car extends Vehicle {\n    private $type = 'car';\n}\n\nclass ElectricCar extends Car {\n    private $batteryCapacity;\n    \n    public function __construct($brand, $batteryCapacity) {\n        parent::__construct($brand);\n        $this-&gt;batteryCapacity = $batteryCapacity;\n    }\n}\n\n\/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u4f5c\u6210\n$vehicle = new Vehicle(\"Generic\");\n$car = new Car(\"Toyota\");\n$electricCar = new ElectricCar(\"Tesla\", 100);\n\n\/\/ instanceof\u5224\u5b9a\nvar_dump($vehicle instanceof Vehicle);     \/\/ bool(true)\nvar_dump($vehicle instanceof Car);         \/\/ bool(false) - \u89aa\u30af\u30e9\u30b9\u306f\u5b50\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u306a\u3044\n\nvar_dump($car instanceof Car);             \/\/ bool(true)\nvar_dump($car instanceof Vehicle);         \/\/ bool(true) - \u5b50\u30af\u30e9\u30b9\u306f\u89aa\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u307f\u306a\u3055\u308c\u308b\n\nvar_dump($electricCar instanceof ElectricCar);  \/\/ bool(true)\nvar_dump($electricCar instanceof Car);          \/\/ bool(true)\nvar_dump($electricCar instanceof Vehicle);      \/\/ bool(true)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-61\">\u591a\u614b\u6027\u3068instanceof\u306e\u6d3b\u7528<\/h3>\n\n\n\n<p>\u591a\u614b\u6027\uff08\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\uff09\u3092\u6d3b\u7528\u3057\u305f\u30b3\u30fc\u30c9\u3067\u306f\u3001<code>instanceof<\/code>\u3092\u4f7f\u3063\u3066\u578b\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u7570\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u3092\u51e6\u7406\u3059\u308b\u4f8b\ninterface FileProcessor {\n    public function process($filePath);\n}\n\nclass CSVProcessor implements FileProcessor {\n    public function process($filePath) {\n        return \"CSV\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406: $filePath\";\n    }\n}\n\nclass XMLProcessor implements FileProcessor {\n    public function process($filePath) {\n        return \"XML\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406: $filePath\";\n    }\n}\n\nclass JSONProcessor implements FileProcessor {\n    public function process($filePath) {\n        return \"JSON\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406: $filePath\";\n    }\n}\n\n\/\/ \u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306b\u5fdc\u3058\u305f\u30d7\u30ed\u30bb\u30c3\u30b5\u3092\u9078\u629e\u3059\u308b\u95a2\u6570\nfunction getProcessorForFile($filePath) {\n    $extension = pathinfo($filePath, PATHINFO_EXTENSION);\n    \n    return match (strtolower($extension)) {\n        'csv' =&gt; new CSVProcessor(),\n        'xml' =&gt; new XMLProcessor(),\n        'json' =&gt; new JSONProcessor(),\n        default =&gt; throw new InvalidArgumentException(\"Unsupported file type: $extension\"),\n    };\n}\n\n\/\/ \u30d7\u30ed\u30bb\u30c3\u30b5\u3092\u4f7f\u7528\u3059\u308b\u95a2\u6570\nfunction processFiles(array $files) {\n    foreach ($files as $file) {\n        try {\n            $processor = getProcessorForFile($file);\n            \n            \/\/ instanceof\u3092\u4f7f\u3063\u3066\u8ffd\u52a0\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u884c\u3046\n            if (!$processor instanceof FileProcessor) {\n                throw new RuntimeException(\"Invalid processor for file: $file\");\n            }\n            \n            echo $processor-&gt;process($file) . \"\\n\";\n            \n        } catch (Exception $e) {\n            echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage() . \"\\n\";\n        }\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$files = [\n    'data\/users.csv',\n    'config\/settings.xml',\n    'api\/response.json',\n    'notes.txt' \/\/ \u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u5f62\u5f0f\n];\n\nprocessFiles($files);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-62\">\u52d5\u7684\u306a\u30af\u30e9\u30b9\u540d\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/h3>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u52d5\u7684\u306a\u30af\u30e9\u30b9\u540d\u3067\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u52d5\u7684\u306a\u30af\u30e9\u30b9\u540d\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af\nfunction isInstanceOf($object, $className) {\n    return $object instanceof $className;\n}\n\n$dateTime = new DateTime();\n\nvar_dump(isInstanceOf($dateTime, 'DateTime'));  \/\/ bool(true)\nvar_dump(isInstanceOf($dateTime, 'stdClass'));  \/\/ bool(false)\n\n\/\/ \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u304b\u3089\u53d6\u5f97\u3057\u305f\u8907\u6570\u306e\u30af\u30e9\u30b9\u540d\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u4f8b\n$classNames = ['DateTime', 'Exception', 'ArrayObject'];\nforeach ($classNames as $className) {\n    echo \"$className: \" . (isInstanceOf($dateTime, $className) ? 'Yes' : 'No') . \"\\n\";\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-63\">instanceof\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3059\u308b\u969b\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/strong> \u2013 \u983b\u7e41\u306a<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u30eb\u30fc\u30d7\u5185\u3067\u306e\u4f7f\u7528\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u7d99\u627f\u95a2\u4fc2\u306e\u7406\u89e3<\/strong> \u2013 \u7d99\u627f\u95a2\u4fc2\u304c\u3042\u308b\u5834\u5408\u3001\u5b50\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u89aa\u30af\u30e9\u30b9\u306b\u5bfe\u3059\u308b<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3067\u3082<code>true<\/code>\u3092\u8fd4\u3059\u3053\u3068\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u540d\u524d\u7a7a\u9593\u306e\u8003\u616e<\/strong> \u2013 \u540d\u524d\u7a7a\u9593\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30af\u30e9\u30b9\u540d\u306b\u306f\u5b8c\u5168\u4fee\u98fe\u540d\u3092\u4f7f\u7528\u3059\u308b\u304b\u3001\u9069\u5207\u306b<code>use<\/code>\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">namespace App\\Service;\n\nclass Logger {}\n\nnamespace App\\Controller;\n\nuse App\\Service\\Logger;\n\n$logger = new Logger();\nvar_dump($logger instanceof Logger);  \/\/ bool(true)\nvar_dump($logger instanceof \\App\\Service\\Logger);  \/\/ bool(true) - \u5b8c\u5168\u4fee\u98fe\u540d\u3082\u4f7f\u7528\u53ef\u80fd\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u975e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u4f7f\u7528<\/strong> \u2013 PHP 7.3\u4ee5\u524d\u3067\u306f\u3001\u975e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5024\u306b\u5bfe\u3057\u3066<code>instanceof<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3068E_NOTICE\u304c\u767a\u751f\u3057\u307e\u3059\u304c\u3001PHP 8.0\u4ee5\u964d\u3067\u306f\u30a8\u30e9\u30fc\u306a\u3057\u3067<code>false<\/code>\u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-64\">\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u578b\u30c1\u30a7\u30c3\u30af\u3088\u308a\u3082\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u512a\u5148\u3059\u308b<\/strong> \u2013 \u53ef\u80fd\u306a\u9650\u308a\u3001\u591a\u6570\u306e<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3092\u4f7f\u7528\u3059\u308b\u3088\u308a\u3082\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3068\u30dd\u30ea\u30e2\u30fc\u30d5\u30a3\u30ba\u30e0\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u578b\u5ba3\u8a00\u3068\u7d44\u307f\u5408\u308f\u305b\u308b<\/strong> \u2013 PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u6a5f\u80fd\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u5ba3\u8a00\u3068instanceof\u306e\u7d44\u307f\u5408\u308f\u305b\nfunction process(object $obj): void {\n    if ($obj instanceof Processable) {\n        $obj-&gt;process();\n    } elseif ($obj instanceof Serializable) {\n        echo serialize($obj);\n    } else {\n        echo \"Unknown object type: \" . get_class($obj);\n    }\n}\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u9069\u5207\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/strong> \u2013 \u671f\u5f85\u3059\u308b\u578b\u3067\u306a\u3044\u5834\u5408\u306e\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u9069\u5207\u306b\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function safelyProcessUser($user) {\n    if (!$user instanceof User) {\n        throw new InvalidArgumentException(\"User instance expected, got: \" . (is_object($user) ? get_class($user) : gettype($user)));\n    }\n    \n    \/\/ \u5b89\u5168\u306b\u51e6\u7406\u3092\u7d9a\u884c\n    return $user-&gt;getProfile();\n}\n<\/pre>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306e\u30bf\u30a4\u30d7\u30bb\u30fc\u30d5\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u578b\u95a2\u9023\u306e\u30d0\u30b0\u3092\u6e1b\u3089\u3057\u3001\u3088\u308a\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-65\">\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306binstanceof\u3092\u4f7f\u3046\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306f\u3001\u5909\u6570\u304c\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3057\u3070\u3057\u3070\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<code>instanceof<\/code>\u6f14\u7b97\u5b50\u306f\u3001\u3053\u306e\u76ee\u7684\u306e\u305f\u3081\u306b\u6700\u9069\u306a\u30c4\u30fc\u30eb\u3067\u3042\u308a\u3001\u7279\u306b\u578b\u306e\u5b89\u5168\u6027\u3092\u78ba\u4fdd\u3057\u306a\u304c\u3089\u67d4\u8edf\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u305f\u3044\u5834\u5408\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-66\">\u30af\u30e9\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/h4>\n\n\n\n<p>\u307e\u305a\u3001\u57fa\u672c\u7684\u306a\u30af\u30e9\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u304b\u3089\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306f\u3001\u5909\u6570\u304c\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u6700\u3082\u76f4\u63a5\u7684\u306a\u65b9\u6cd5\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class User {\n    public function __construct(public string $name, public string $email) {}\n    \n    public function getDisplayName(): string {\n        return $this-&gt;name;\n    }\n}\n\nclass Admin extends User {\n    public function __construct(string $name, string $email, public array $permissions = []) {\n        parent::__construct($name, $email);\n    }\n    \n    public function hasPermission(string $permission): bool {\n        return in_array($permission, $this-&gt;permissions);\n    }\n}\n\nfunction processUser($user) {\n    \/\/ \u57fa\u672c\u7684\u306a\u30af\u30e9\u30b9\u30c1\u30a7\u30c3\u30af\n    if ($user instanceof User) {\n        echo \"\u51e6\u7406\u3059\u308b\u30e6\u30fc\u30b6\u30fc: \" . $user-&gt;getDisplayName() . \"\\n\";\n        \n        \/\/ \u6d3e\u751f\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n        if ($user instanceof Admin) {\n            echo \"\u7ba1\u7406\u8005\u6a29\u9650\u3092\u6301\u3064\u30e6\u30fc\u30b6\u30fc\u3067\u3059\\n\";\n            \n            if ($user-&gt;hasPermission('delete')) {\n                echo \"\u524a\u9664\u6a29\u9650\u304c\u3042\u308a\u307e\u3059\\n\";\n            }\n        } else {\n            echo \"\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3067\u3059\\n\";\n        }\n    } else {\n        echo \"\u30e6\u30fc\u30b6\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\\n\";\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$regularUser = new User(\"John Doe\", \"john@example.com\");\n$adminUser = new Admin(\"Admin User\", \"admin@example.com\", ['view', 'edit', 'delete']);\n$notUser = new stdClass();\n\nprocessUser($regularUser); \/\/ \u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u51e6\u7406\nprocessUser($adminUser);   \/\/ \u7ba1\u7406\u8005\u30e6\u30fc\u30b6\u30fc\u3068\u3057\u3066\u51e6\u7406\nprocessUser($notUser);     \/\/ \u30e6\u30fc\u30b6\u30fc\u3067\u306f\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u51e6\u7406\n<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001<code>instanceof<\/code>\u3092\u4f7f\u3063\u3066\u57fa\u672c\u30af\u30e9\u30b9\uff08User\uff09\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3044\u3001\u3055\u3089\u306b\u6d3e\u751f\u30af\u30e9\u30b9\uff08Admin\uff09\u306e\u30c1\u30a7\u30c3\u30af\u3082\u884c\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-67\">\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/h4>\n\n\n\n<p>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u3082<code>instanceof<\/code>\u6f14\u7b97\u5b50\u3092\u4f7f\u3044\u307e\u3059\u3002\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f7f\u3063\u305f\u578b\u30c1\u30a7\u30c3\u30af\u306f\u3001\u7279\u5b9a\u306e\u6a5f\u80fd\u3092\u6301\u3064\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9a\u7fa9\ninterface Loggable {\n    public function getLogMessage(): string;\n}\n\ninterface Serializable {\n    public function serialize(): string;\n    public function unserialize(string $data): void;\n}\n\n\/\/ \u8907\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u30af\u30e9\u30b9\nclass LoggableUser extends User implements Loggable {\n    public function getLogMessage(): string {\n        return \"User: {$this-&gt;name} ({$this-&gt;email})\";\n    }\n}\n\nclass FullFeaturedUser extends User implements Loggable, Serializable {\n    public function getLogMessage(): string {\n        return \"User: {$this-&gt;name} ({$this-&gt;email})\";\n    }\n    \n    public function serialize(): string {\n        return json_encode([\n            'name' =&gt; $this-&gt;name,\n            'email' =&gt; $this-&gt;email\n        ]);\n    }\n    \n    public function unserialize(string $data): void {\n        $unserialized = json_decode($data, true);\n        $this-&gt;name = $unserialized['name'] ?? '';\n        $this-&gt;email = $unserialized['email'] ?? '';\n    }\n}\n\n\/\/ \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u57fa\u3065\u304f\u51e6\u7406\u306e\u5206\u5c90\nfunction processObject($object) {\n    if ($object instanceof Loggable) {\n        echo \"\u30ed\u30b0\u30e1\u30c3\u30bb\u30fc\u30b8: \" . $object-&gt;getLogMessage() . \"\\n\";\n    }\n    \n    if ($object instanceof Serializable) {\n        echo \"\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u7d50\u679c: \" . $object-&gt;serialize() . \"\\n\";\n    }\n    \n    if (!($object instanceof Loggable) &amp;&amp; !($object instanceof Serializable)) {\n        echo \"\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\\n\";\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$regularUser = new User(\"Regular User\", \"user@example.com\");\n$loggableUser = new LoggableUser(\"Loggable User\", \"log@example.com\");\n$fullUser = new FullFeaturedUser(\"Full User\", \"full@example.com\");\n\nprocessObject($regularUser); \/\/ \u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\nprocessObject($loggableUser); \/\/ Loggable\u306e\u307f\nprocessObject($fullUser);     \/\/ Loggable\u3068Serializable\u306e\u4e21\u65b9\n<\/pre>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<code>instanceof<\/code>\u3092\u4f7f\u3063\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7279\u5b9a\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u305d\u308c\u306b\u57fa\u3065\u3044\u3066\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306f\u300c\u632f\u308b\u821e\u3044\u306b\u57fa\u3065\u3044\u305f\u578b\u30c1\u30a7\u30c3\u30af\u300d\u3068\u547c\u3070\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-68\">\u62bd\u8c61\u30af\u30e9\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/h4>\n\n\n\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u3082\u540c\u69d8\u306b<code>instanceof<\/code>\u3067\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u62bd\u8c61\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9\nabstract class Shape {\n    abstract public function getArea(): float;\n    \n    public function describe(): string {\n        return \"\u3053\u308c\u306f\u56f3\u5f62\u3067\u3059\u3002\u9762\u7a4d: \" . $this-&gt;getArea();\n    }\n}\n\nclass Circle extends Shape {\n    public function __construct(private float $radius) {}\n    \n    public function getArea(): float {\n        return pi() * $this-&gt;radius * $this-&gt;radius;\n    }\n}\n\nclass Rectangle extends Shape {\n    public function __construct(private float $width, private float $height) {}\n    \n    public function getArea(): float {\n        return $this-&gt;width * $this-&gt;height;\n    }\n}\n\nfunction processShape($shape) {\n    \/\/ \u62bd\u8c61\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n    if ($shape instanceof Shape) {\n        echo $shape-&gt;describe() . \"\\n\";\n        \n        \/\/ \u5177\u4f53\u7684\u306a\u5b9f\u88c5\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n        if ($shape instanceof Circle) {\n            echo \"\u3053\u308c\u306f\u5186\u3067\u3059\\n\";\n        } elseif ($shape instanceof Rectangle) {\n            echo \"\u3053\u308c\u306f\u9577\u65b9\u5f62\u3067\u3059\\n\";\n        } else {\n            echo \"\u305d\u306e\u4ed6\u306e\u56f3\u5f62\u3067\u3059\\n\";\n        }\n    } else {\n        echo \"\u56f3\u5f62\u3067\u306f\u3042\u308a\u307e\u305b\u3093\\n\";\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$circle = new Circle(5);\n$rectangle = new Rectangle(4, 6);\n$nonShape = new stdClass();\n\nprocessShape($circle);     \/\/ \u5186\u3068\u3057\u3066\u51e6\u7406\nprocessShape($rectangle);  \/\/ \u9577\u65b9\u5f62\u3068\u3057\u3066\u51e6\u7406\nprocessShape($nonShape);   \/\/ \u56f3\u5f62\u3067\u306f\u306a\u3044\u3068\u3057\u3066\u51e6\u7406\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-69\">\u8907\u6570\u6761\u4ef6\u306e\u7d44\u307f\u5408\u308f\u305b<\/h4>\n\n\n\n<p>\u8907\u6570\u306e\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30c1\u30a7\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processComplexObject($object) {\n    \/\/ \u30af\u30e9\u30b9\u3068\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u30c1\u30a7\u30c3\u30af\n    if ($object instanceof User &amp;&amp; $object instanceof Loggable) {\n        echo \"\u30ed\u30b0\u53ef\u80fd\u306a\u30e6\u30fc\u30b6\u30fc\u3067\u3059: \" . $object-&gt;getLogMessage() . \"\\n\";\n    }\n    \n    \/\/ \u8907\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u30c1\u30a7\u30c3\u30af\n    if ($object instanceof Loggable &amp;&amp; $object instanceof Serializable) {\n        echo \"\u30ed\u30b0\u53ef\u80fd\u304b\u3064\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u53ef\u80fd\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\\n\";\n    }\n    \n    \/\/ \u7279\u5b9a\u306e\u30af\u30e9\u30b9\u3067\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\n    if ($object instanceof User &amp;&amp; !($object instanceof Admin)) {\n        echo \"\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3067\u3059\uff08\u7ba1\u7406\u8005\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff09\\n\";\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-70\">\u578b\u30c1\u30a7\u30c3\u30af\u306e\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3<\/h4>\n\n\n\n<p><code>instanceof<\/code>\u3092\u4f7f\u3063\u305f\u578b\u30c1\u30a7\u30c3\u30af\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u30c7\u30b6\u30a4\u30f3\u30d1\u30bf\u30fc\u30f3\u3067\u6d3b\u7528\u3055\u308c\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<p><strong>1. \u30d3\u30b8\u30bf\u30fc\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface Visitable {\n    public function accept(Visitor $visitor);\n}\n\ninterface Visitor {\n    public function visitUser(User $user);\n    public function visitAdmin(Admin $user);\n}\n\n\/\/ Visitable\u3092\u5b9f\u88c5\u3059\u308b\u30af\u30e9\u30b9\nclass VisitableUser extends User implements Visitable {\n    public function accept(Visitor $visitor) {\n        if ($this instanceof Admin) {\n            $visitor-&gt;visitAdmin($this);\n        } else {\n            $visitor-&gt;visitUser($this);\n        }\n    }\n}\n\n\/\/ \u30d3\u30b8\u30bf\u30fc\u5b9f\u88c5\u306e\u4f8b\nclass UserReportVisitor implements Visitor {\n    public function visitUser(User $user) {\n        echo \"\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u30ec\u30dd\u30fc\u30c8: {$user-&gt;name}\\n\";\n    }\n    \n    public function visitAdmin(Admin $user) {\n        echo \"\u7ba1\u7406\u8005\u30ec\u30dd\u30fc\u30c8: {$user-&gt;name} (\u6a29\u9650: \" . implode(\", \", $user-&gt;permissions) . \")\\n\";\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$visitor = new UserReportVisitor();\n$user = new VisitableUser(\"John\", \"john@example.com\");\n$admin = new Admin(\"Admin\", \"admin@example.com\", [\"view\", \"edit\"]);\n\n$user-&gt;accept($visitor);\n$admin-&gt;accept($visitor);\n<\/pre>\n\n\n\n<p><strong>2. \u30d5\u30a1\u30af\u30c8\u30ea\u30fc\u30d1\u30bf\u30fc\u30f3<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface UserFactory {\n    public function createUser(array $data): User;\n}\n\nclass StandardUserFactory implements UserFactory {\n    public function createUser(array $data): User {\n        if (isset($data['permissions']) &amp;&amp; is_array($data['permissions'])) {\n            return new Admin(\n                $data['name'] ?? '',\n                $data['email'] ?? '',\n                $data['permissions']\n            );\n        }\n        \n        return new User(\n            $data['name'] ?? '',\n            $data['email'] ?? ''\n        );\n    }\n}\n\n\/\/ \u30d5\u30a1\u30af\u30c8\u30ea\u30fc\u306e\u4f7f\u7528\nfunction processUserData(array $userData, UserFactory $factory) {\n    $user = $factory-&gt;createUser($userData);\n    \n    \/\/ instanceof\u3067\u4f5c\u6210\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u3092\u30c1\u30a7\u30c3\u30af\n    if ($user instanceof Admin) {\n        echo \"\u7ba1\u7406\u8005\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f: {$user-&gt;name}\\n\";\n    } else {\n        echo \"\u4e00\u822c\u30e6\u30fc\u30b6\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f: {$user-&gt;name}\\n\";\n    }\n    \n    return $user;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-71\">\u5b9f\u8df5\u7684\u306a\u30d2\u30f3\u30c8<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>instanceof vs \u578b\u5ba3\u8a00<\/strong>\uff1aPHP 7\u4ee5\u964d\u3067\u306f\u3001\u578b\u5ba3\u8a00\u3068<code>instanceof<\/code>\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u5ba3\u8a00\u3068instanceof\u306e\u7d44\u307f\u5408\u308f\u305b\nfunction processAdmin(User $user): void {\n    \/\/ \u578b\u5ba3\u8a00\u3067\u57fa\u672c\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\u306f\u78ba\u4fdd\u3055\u308c\u305f\u4e0a\u3067\n    \/\/ \u3088\u308a\u5177\u4f53\u7684\u306a\u30b5\u30d6\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\n    if ($user instanceof Admin) {\n        echo \"\u7ba1\u7406\u8005\uff1a\" . $user-&gt;getDisplayName() . \"\\n\";\n        \/\/ \u7ba1\u7406\u8005\u56fa\u6709\u306e\u51e6\u7406\n    } else {\n        throw new InvalidArgumentException(\"\u7ba1\u7406\u8005\u6a29\u9650\u304c\u5fc5\u8981\u3067\u3059\");\n    }\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u30d1\u30bf\u30fc\u30f3<\/strong>\uff1a<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3068\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getUserPermission($user) {\n    if (!($user instanceof User)) {\n        return null; \/\/ \u7121\u52b9\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\n    }\n    \n    if ($user instanceof Admin) {\n        return $user-&gt;permissions; \/\/ \u7ba1\u7406\u8005\u306e\u6a29\u9650\n    }\n    \n    return ['read']; \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u6a29\u9650\n}\n<\/pre>\n\n\n\n<p><code>instanceof<\/code>\u6f14\u7b97\u5b50\u3092\u4f7f\u3063\u305f\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306f\u3001\u30bf\u30a4\u30d7\u30bb\u30fc\u30d5\u306aPHP\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u306b\u5fdc\u3058\u305f\u51e6\u7406\u3092\u5b89\u5168\u306b\u884c\u3048\u3001\u30b3\u30fc\u30c9\u306e\u5805\u7262\u6027\u3068\u53ef\u8aad\u6027\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-72\">\u7d99\u627f\u95a2\u4fc2\u306b\u3042\u308b\u30af\u30e9\u30b9\u306e\u578b\u5224\u5b9a\u6642\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>\u30af\u30e9\u30b9\u306e\u7d99\u627f\u95a2\u4fc2\u304c\u3042\u308b\u5834\u5408\u3001<code>instanceof<\/code>\u6f14\u7b97\u5b50\u306e\u6319\u52d5\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u91cd\u8981\u306a\u7279\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u3092\u7406\u89e3\u305b\u305a\u306b\u4f7f\u7528\u3059\u308b\u3068\u3001\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3084\u8ad6\u7406\u30a8\u30e9\u30fc\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u7d99\u627f\u95a2\u4fc2\u3092\u6301\u3064\u30af\u30e9\u30b9\u306e\u578b\u5224\u5b9a\u6642\u306b\u6ce8\u610f\u3059\u3079\u304d\u30dd\u30a4\u30f3\u30c8\u3092\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-73\">1. \u7d99\u627f\u65b9\u5411\u306e\u7406\u89e3<\/h4>\n\n\n\n<p>\u6700\u3082\u91cd\u8981\u306a\u6ce8\u610f\u70b9\u306f\u3001\u7d99\u627f\u306e\u65b9\u5411\u6027\u3068<code>instanceof<\/code>\u306e\u6319\u52d5\u306e\u95a2\u4fc2\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b50\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u89aa\u30af\u30e9\u30b9\u306e<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3067<strong>\u771f<\/strong>\u306b\u306a\u308a\u307e\u3059<\/li>\n\n\n\n<li>\u89aa\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u5b50\u30af\u30e9\u30b9\u306e<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3067<strong>\u507d<\/strong>\u306b\u306a\u308a\u307e\u3059<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Animal {\n    protected $name;\n    \n    public function __construct($name) {\n        $this-&gt;name = $name;\n    }\n    \n    public function getName() {\n        return $this-&gt;name;\n    }\n}\n\nclass Dog extends Animal {\n    public function bark() {\n        return \"Woof!\";\n    }\n}\n\n$animal = new Animal(\"Generic Animal\");\n$dog = new Dog(\"Buddy\");\n\n\/\/ \u5b50\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b\u89aa\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\nvar_dump($dog instanceof Animal);    \/\/ bool(true) - \u72ac\u306f\u52d5\u7269\u3067\u3042\u308b\nvar_dump($dog instanceof Dog);       \/\/ bool(true) - \u72ac\u306f\u72ac\u3067\u3042\u308b\n\n\/\/ \u89aa\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b\u5b50\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\nvar_dump($animal instanceof Animal); \/\/ bool(true) - \u52d5\u7269\u306f\u52d5\u7269\u3067\u3042\u308b\nvar_dump($animal instanceof Dog);    \/\/ bool(false) - \u52d5\u7269\u306f\u5fc5\u305a\u3057\u3082\u72ac\u3067\u306f\u306a\u3044\n<\/pre>\n\n\n\n<p>\u3053\u306e\u6319\u52d5\u306f\u76f4\u611f\u7684\u306a\u3082\u306e\u3067\u3059\u304c\u3001\u8907\u96d1\u306a\u6761\u4ef6\u5206\u5c90\u3092\u66f8\u304f\u969b\u306b\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-74\">2. \u6761\u4ef6\u5206\u5c90\u306e\u9806\u5e8f\u306b\u6ce8\u610f\u3059\u308b<\/h4>\n\n\n\n<p>\u7d99\u627f\u95a2\u4fc2\u306e\u3042\u308b\u30af\u30e9\u30b9\u306b\u5bfe\u3057\u3066\u6761\u4ef6\u5206\u5c90\u3092\u884c\u3046\u5834\u5408\u3001\u30c1\u30a7\u30c3\u30af\u306e\u9806\u5e8f\u304c\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002\u5177\u4f53\u7684\u306a\u30af\u30e9\u30b9\uff08\u5b50\u30af\u30e9\u30b9\uff09\u304b\u3089\u5148\u306b\u30c1\u30a7\u30c3\u30af\u3057\u3001\u305d\u306e\u5f8c\u306b\u4e00\u822c\u7684\u306a\u30af\u30e9\u30b9\uff08\u89aa\u30af\u30e9\u30b9\uff09\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u9806\u5e8f\u306b\u3059\u3079\u304d\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u304f\u306a\u3044\u4f8b\uff08\u89aa\u30af\u30e9\u30b9\u3092\u5148\u306b\u30c1\u30a7\u30c3\u30af\uff09\nfunction processAnimal($animal) {\n    if ($animal instanceof Animal) {\n        echo $animal-&gt;getName() . \"\u306f\u52d5\u7269\u3067\u3059\\n\";\n        \/\/ \u3053\u3053\u3067Dog\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u305b\u306a\u3044\n        \n        \/\/ \u3053\u306e\u30d6\u30ed\u30c3\u30af\u306fDog\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3082\u5b9f\u884c\u3055\u308c\u308b\n    }\n    \n    if ($animal instanceof Dog) {\n        echo $animal-&gt;getName() . \"\u306f\u72ac\u3067\u3059\\n\";\n        echo $animal-&gt;bark() . \"\\n\";\n        \/\/ \u3053\u306e\u30d6\u30ed\u30c3\u30af\u306fDog\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u307f\u5b9f\u884c\u3055\u308c\u308b\n    }\n}\n\n\/\/ \u826f\u3044\u4f8b\uff08\u5b50\u30af\u30e9\u30b9\u3092\u5148\u306b\u30c1\u30a7\u30c3\u30af\uff09\nfunction betterProcessAnimal($animal) {\n    if ($animal instanceof Dog) {\n        echo $animal-&gt;getName() . \"\u306f\u72ac\u3067\u3059\\n\";\n        echo $animal-&gt;bark() . \"\\n\";\n    } elseif ($animal instanceof Animal) {\n        echo $animal-&gt;getName() . \"\u306f\u52d5\u7269\u3067\u3059\u304c\u3001\u72ac\u3067\u306f\u3042\u308a\u307e\u305b\u3093\\n\";\n    } else {\n        echo \"\u3053\u308c\u306f\u52d5\u7269\u3067\u306f\u3042\u308a\u307e\u305b\u3093\\n\";\n    }\n}\n\n$animal = new Animal(\"Generic Animal\");\n$dog = new Dog(\"Buddy\");\n\nprocessAnimal($animal);  \/\/ \"Generic Animal\u306f\u52d5\u7269\u3067\u3059\"\nprocessAnimal($dog);     \/\/ \"Buddy\u306f\u52d5\u7269\u3067\u3059\" \u3068 \"Buddy\u306f\u72ac\u3067\u3059\" \u3068 \"Woof!\"\n\nbetterProcessAnimal($animal);  \/\/ \"Generic Animal\u306f\u52d5\u7269\u3067\u3059\u304c\u3001\u72ac\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"\nbetterProcessAnimal($dog);     \/\/ \"Buddy\u306f\u72ac\u3067\u3059\" \u3068 \"Woof!\"\n<\/pre>\n\n\n\n<p>\u9069\u5207\u306a\u9806\u5e8f\u3067\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\u3068\u3001\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\u3084\u6761\u4ef6\u5206\u5c90\u306e\u91cd\u8907\u5b9f\u884c\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-75\">3. \u591a\u91cd\u7d99\u627f\u3068\u8907\u6570\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>PHP\u306f\u30af\u30e9\u30b9\u306e\u591a\u91cd\u7d99\u627f\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u8907\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u3001\u8907\u6570\u306e\u578b\u30c1\u30a7\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface Walkable {\n    public function walk();\n}\n\ninterface Swimmable {\n    public function swim();\n}\n\nclass Fish implements Swimmable {\n    public function swim() {\n        return \"\u9b5a\u304c\u6cf3\u3044\u3067\u3044\u307e\u3059\";\n    }\n}\n\nclass Duck extends Animal implements Walkable, Swimmable {\n    public function walk() {\n        return \"\u30a2\u30d2\u30eb\u304c\u6b69\u3044\u3066\u3044\u307e\u3059\";\n    }\n    \n    public function swim() {\n        return \"\u30a2\u30d2\u30eb\u304c\u6cf3\u3044\u3067\u3044\u307e\u3059\";\n    }\n}\n\nfunction moveAnimal($animal) {\n    $actions = [];\n    \n    if ($animal instanceof Walkable) {\n        $actions[] = $animal-&gt;walk();\n    }\n    \n    if ($animal instanceof Swimmable) {\n        $actions[] = $animal-&gt;swim();\n    }\n    \n    if (empty($actions)) {\n        return \"\u3053\u306e\u52d5\u7269\u306f\u79fb\u52d5\u3067\u304d\u307e\u305b\u3093\";\n    }\n    \n    return implode(\", \", $actions);\n}\n\n$fish = new Fish();\n$duck = new Duck(\"Donald\");\n\necho moveAnimal($fish) . \"\\n\";  \/\/ \"\u9b5a\u304c\u6cf3\u3044\u3067\u3044\u307e\u3059\"\necho moveAnimal($duck) . \"\\n\";  \/\/ \"\u30a2\u30d2\u30eb\u304c\u6b69\u3044\u3066\u3044\u307e\u3059, \u30a2\u30d2\u30eb\u304c\u6cf3\u3044\u3067\u3044\u307e\u3059\"\n<\/pre>\n\n\n\n<p>\u8907\u6570\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30af\u30e9\u30b9\u3067\u306f\u3001\u8907\u6570\u306e<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u304c\u771f\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3053\u3068\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-76\">4. \u7d99\u627f\u6df1\u5ea6\u306e\u554f\u984c<\/h4>\n\n\n\n<p>\u7d99\u627f\u306e\u968e\u5c64\u304c\u6df1\u3044\u5834\u5408\u3001<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u306f\u89aa\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30fc\u30f3\u5168\u4f53\u3092\u3055\u304b\u306e\u307c\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Animal {}\nclass Mammal extends Animal {}\nclass Canine extends Mammal {}\nclass Dog extends Canine {}\nclass GermanShepherd extends Dog {}\n\n$dog = new GermanShepherd();\n\nvar_dump($dog instanceof GermanShepherd);  \/\/ bool(true)\nvar_dump($dog instanceof Dog);             \/\/ bool(true)\nvar_dump($dog instanceof Canine);          \/\/ bool(true)\nvar_dump($dog instanceof Mammal);          \/\/ bool(true)\nvar_dump($dog instanceof Animal);          \/\/ bool(true)\n<\/pre>\n\n\n\n<p>\u7d99\u627f\u968e\u5c64\u304c\u6df1\u3044\u3068\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u6b63\u78ba\u306a\u578b\u3092\u7279\u5b9a\u3059\u308b\u305f\u3081\u306b\u8907\u6570\u306e<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u304c\u5fc5\u8981\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u7169\u96d1\u306b\u306a\u308b\u5834\u5408\u306f\u3001<code>get_class()<\/code>\u95a2\u6570\u3092\u4f7f\u3063\u3066\u6b63\u78ba\u306a\u30af\u30e9\u30b9\u540d\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3082\u691c\u8a0e\u3057\u3066\u304f\u3060\u3055\u3044\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getExactClassName($object) {\n    return get_class($object);\n}\n\n$dog = new GermanShepherd();\necho getExactClassName($dog);  \/\/ \"GermanShepherd\"\n\n\/\/ \u30af\u30e9\u30b9\u540d\u306e\u6bd4\u8f03\nif (get_class($dog) === 'GermanShepherd') {\n    echo \"\u3053\u308c\u306f\u6b63\u78ba\u306bGermanShepherd\u3067\u3059\\n\";\n}\n<\/pre>\n\n\n\n<p>\u305f\u3060\u3057\u3001<code>get_class()<\/code>\u306f\u53b3\u5bc6\u306a\u30af\u30e9\u30b9\u540d\u306e\u307f\u3092\u8fd4\u3057\u3001\u89aa\u30af\u30e9\u30b9\u3068\u306e\u95a2\u4fc2\u306f\u8003\u616e\u3057\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-77\">5. \u62bd\u8c61\u30af\u30e9\u30b9\u3068\u5177\u8c61\u30af\u30e9\u30b9\u306e\u95a2\u4fc2<\/h4>\n\n\n\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u3082instanceof\u30c1\u30a7\u30c3\u30af\u3067\u8003\u616e\u3055\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">abstract class Shape {\n    abstract public function area();\n}\n\nclass Circle extends Shape {\n    private $radius;\n    \n    public function __construct($radius) {\n        $this-&gt;radius = $radius;\n    }\n    \n    public function area() {\n        return pi() * $this-&gt;radius * $this-&gt;radius;\n    }\n}\n\n$circle = new Circle(5);\nvar_dump($circle instanceof Shape);  \/\/ bool(true)\nvar_dump($circle instanceof Circle); \/\/ bool(true)\n<\/pre>\n\n\n\n<p>\u3053\u308c\u306f\u3001\u62bd\u8c61\u30af\u30e9\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u969b\u306b\u7279\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-78\">6. self, parent\u30ad\u30fc\u30ef\u30fc\u30c9\u3068instanceof\u306e\u95a2\u4fc2<\/h4>\n\n\n\n<p>\u30af\u30e9\u30b9\u5185\u90e8\u3067\u306f\u3001<code>self<\/code>\u3084<code>parent<\/code>\u30ad\u30fc\u30ef\u30fc\u30c9\u3092<code>instanceof<\/code>\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class ParentClass {\n    public function checkInstance($obj) {\n        return $obj instanceof self;  \/\/ ParentClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u30c1\u30a7\u30c3\u30af\n    }\n}\n\nclass ChildClass extends ParentClass {\n    public function checkParentInstance($obj) {\n        return $obj instanceof parent;  \/\/ ParentClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u30c1\u30a7\u30c3\u30af\n    }\n    \n    public function checkSelfInstance($obj) {\n        return $obj instanceof self;  \/\/ ChildClass\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u30c1\u30a7\u30c3\u30af\n    }\n}\n\n$parent = new ParentClass();\n$child = new ChildClass();\n\nvar_dump($parent-&gt;checkInstance($parent));  \/\/ bool(true)\nvar_dump($parent-&gt;checkInstance($child));   \/\/ bool(false) - self\u306f\u5b9f\u884c\u30af\u30e9\u30b9\u3092\u53c2\u7167\n\nvar_dump($child-&gt;checkParentInstance($parent));  \/\/ bool(true)\nvar_dump($child-&gt;checkParentInstance($child));   \/\/ bool(true) - \u5b50\u30af\u30e9\u30b9\u306f\u89aa\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\n\nvar_dump($child-&gt;checkSelfInstance($parent));  \/\/ bool(false)\nvar_dump($child-&gt;checkSelfInstance($child));   \/\/ bool(true)\n<\/pre>\n\n\n\n<p><code>self<\/code>\u306f\u5e38\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u30af\u30e9\u30b9\u81ea\u4f53\u3092\u53c2\u7167\u3057\u3001<code>parent<\/code>\u306f\u89aa\u30af\u30e9\u30b9\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-79\">7. \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u306a\u3044\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af<\/h4>\n\n\n\n<p>\u62bd\u8c61\u30af\u30e9\u30b9\u3084\u3001<code>new<\/code>\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u76f4\u63a5\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u306a\u3044\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\u3082\u3001<code>instanceof<\/code>\u3067\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u306a\u3044\u30af\u30e9\u30b9\u306e\u4f8b\nabstract class Database {\n    abstract public function connect();\n}\n\nclass MySQLDatabase extends Database {\n    public function connect() {\n        return \"MySQL\u63a5\u7d9a\";\n    }\n}\n\nfunction processDatabase($db) {\n    if ($db instanceof Database) {  \/\/ \u62bd\u8c61\u30af\u30e9\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n        echo \"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059: \" . $db-&gt;connect() . \"\\n\";\n    } else {\n        echo \"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3042\u308a\u307e\u305b\u3093\\n\";\n    }\n}\n\n$mysql = new MySQLDatabase();\nprocessDatabase($mysql);  \/\/ \"\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059: MySQL\u63a5\u7d9a\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-80\">\u307e\u3068\u3081: \u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<p>\u7d99\u627f\u95a2\u4fc2\u306b\u3042\u308b\u30af\u30e9\u30b9\u306e\u578b\u5224\u5b9a\u3092\u884c\u3046\u969b\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5177\u4f53\u304b\u3089\u4e00\u822c\u3078<\/strong>: \u6700\u3082\u5177\u4f53\u7684\u306a\u30af\u30e9\u30b9\uff08\u5b50\u30af\u30e9\u30b9\uff09\u304b\u3089\u6700\u3082\u4e00\u822c\u7684\u306a\u30af\u30e9\u30b9\uff08\u89aa\u30af\u30e9\u30b9\uff09\u306e\u9806\u5e8f\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/li>\n\n\n\n<li><strong>\u968e\u5c64\u3092\u610f\u8b58\u3059\u308b<\/strong>: \u7d99\u627f\u968e\u5c64\u304c\u8907\u96d1\u306a\u5834\u5408\u306f\u3001\u9069\u5207\u306a\u30ec\u30d9\u30eb\u3067\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/li>\n\n\n\n<li><strong>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u6d3b\u7528<\/strong>: \u5177\u4f53\u7684\u306a\u5b9f\u88c5\u3088\u308a\u3082\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u3088\u308b\u578b\u30c1\u30a7\u30c3\u30af\u3092\u512a\u5148\u3059\u308b<\/li>\n\n\n\n<li><strong>elseif\u306e\u6d3b\u7528<\/strong>: \u7d99\u627f\u95a2\u4fc2\u306b\u3042\u308b\u30af\u30e9\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306f\u3001<code>elseif<\/code>\u3092\u4f7f\u7528\u3057\u3066\u76f8\u4e92\u6392\u4ed6\u7684\u306a\u6761\u4ef6\u5206\u5c90\u306b\u3059\u308b<\/li>\n\n\n\n<li><strong>instanceof \u3068\u578b\u5ba3\u8a00\u306e\u4f75\u7528<\/strong>: PHP 7\u4ee5\u964d\u3067\u306f\u3001\u578b\u5ba3\u8a00\u3068<code>instanceof<\/code>\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u5ba3\u8a00\u3068instanceof\u306e\u4f75\u7528\u4f8b\nfunction processShape(Shape $shape): float {\n    \/\/ \u3059\u3067\u306bShape\u3067\u3042\u308b\u3053\u3068\u306f\u578b\u5ba3\u8a00\u3067\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u308b\n    \n    if ($shape instanceof Circle) {\n        \/\/ \u5186\u56fa\u6709\u306e\u8ffd\u52a0\u51e6\u7406\n        echo \"\u5186\u306e\u51e6\u7406\u3092\u5b9f\u884c\\n\";\n    } elseif ($shape instanceof Rectangle) {\n        \/\/ \u9577\u65b9\u5f62\u56fa\u6709\u306e\u8ffd\u52a0\u51e6\u7406\n        echo \"\u9577\u65b9\u5f62\u306e\u51e6\u7406\u3092\u5b9f\u884c\\n\";\n    } else {\n        \/\/ \u305d\u306e\u4ed6\u306eShape\u6d3e\u751f\u30af\u30e9\u30b9\u306e\u51e6\u7406\n        echo \"\u305d\u306e\u4ed6\u306e\u56f3\u5f62\u306e\u51e6\u7406\u3092\u5b9f\u884c\\n\";\n    }\n    \n    \/\/ \u5171\u901a\u51e6\u7406\uff08Shape\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u4fdd\u8a3c\u3055\u308c\u305f\u30e1\u30bd\u30c3\u30c9\uff09\n    return $shape-&gt;area();\n}\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6ce8\u610f\u70b9\u3068\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u306e\u578b\u5224\u5b9a\u3092\u3088\u308a\u52b9\u679c\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-81\">PHP 8\u306e\u65b0\u6a5f\u80fd\u300c\u30de\u30c3\u30c1\u5f0f\u300d\u3092\u4f7f\u3063\u305f\u578b\u306b\u3088\u308b\u5206\u5c90\u51e6\u7406<\/h2>\n\n\n\n<p>PHP 8\u3067\u306f\u3001\u6761\u4ef6\u5206\u5c90\u3092\u884c\u3046\u305f\u3081\u306e\u65b0\u3057\u3044\u69cb\u6587\u3068\u3057\u3066\u300c\u30de\u30c3\u30c1\u5f0f\u300d\uff08match expression\uff09\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306fswitch\u6587\u306e\u6539\u826f\u7248\u3068\u3082\u8a00\u3048\u308b\u3082\u306e\u3067\u3001\u3088\u308a\u7c21\u6f54\u304b\u3064\u5b89\u5168\u306b\u6761\u4ef6\u5206\u5c90\u3092\u8a18\u8ff0\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3059\u3002\u7279\u306b\u578b\u306b\u57fa\u3065\u3044\u305f\u5206\u5c90\u51e6\u7406\u306b\u304a\u3044\u3066\u3001\u30de\u30c3\u30c1\u5f0f\u306f\u305d\u306e\u771f\u4fa1\u3092\u767a\u63ee\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-82\">\u30de\u30c3\u30c1\u5f0f\u3068switch\u6587\u306e\u9055\u3044<\/h3>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u306fswitch\u6587\u3068\u4f3c\u305f\u6a5f\u80fd\u3092\u6301\u3061\u307e\u3059\u304c\u3001\u3044\u304f\u3064\u304b\u306e\u91cd\u8981\u306a\u9055\u3044\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5f0f\uff08Expression\uff09\u3067\u3042\u308b<\/strong>: \u30de\u30c3\u30c1\u5f0f\u306f\u5024\u3092\u8fd4\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u53b3\u683c\u306a\u6bd4\u8f03<\/strong>: \u30de\u30c3\u30c1\u5f0f\u306f<code>===<\/code>\uff08\u53b3\u683c\u306a\u6bd4\u8f03\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u304c\u3001switch\u6587\u306f<code>==<\/code>\uff08\u7de9\u3084\u304b\u306a\u6bd4\u8f03\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30d5\u30a9\u30fc\u30eb\u30b9\u30eb\u30fc\u304c\u306a\u3044<\/strong>: case\u3054\u3068\u306b\u81ea\u52d5\u7684\u306bbreak\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u3088\u308a\u7c21\u6f54\u306a\u69cb\u6587<\/strong>: \u77e2\u5370\uff08=&gt;\uff09\u3092\u4f7f\u7528\u3057\u3066\u6761\u4ef6\u3068\u7d50\u679c\u3092\u76f4\u63a5\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u4f8b\u5916\u767a\u751f<\/strong>: \u30de\u30c3\u30c1\u3059\u308b\u6761\u4ef6\u304c\u306a\u3044\u5834\u5408\u3001UnhandledMatchError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001switch\u6587\u3068\u30de\u30c3\u30c1\u5f0f\u306e\u6bd4\u8f03\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ switch\u6587\u306e\u4f8b\nfunction getStatusMessageWithSwitch($statusCode) {\n    switch ($statusCode) {\n        case 200:\n            $message = \"OK\";\n            break;\n        case 404:\n            $message = \"Not Found\";\n            break;\n        case 500:\n            $message = \"Server Error\";\n            break;\n        default:\n            $message = \"Unknown Status\";\n            break;\n    }\n    return $message;\n}\n\n\/\/ \u30de\u30c3\u30c1\u5f0f\u306e\u4f8b\nfunction getStatusMessageWithMatch($statusCode) {\n    return match ($statusCode) {\n        200 =&gt; \"OK\",\n        404 =&gt; \"Not Found\",\n        500 =&gt; \"Server Error\",\n        default =&gt; \"Unknown Status\",\n    };\n}\n\necho getStatusMessageWithSwitch(200); \/\/ \"OK\"\necho getStatusMessageWithMatch(200);  \/\/ \"OK\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-83\">\u578b\u306b\u57fa\u3065\u3044\u305f\u5206\u5c90\u306b\u30de\u30c3\u30c1\u5f0f\u3092\u6d3b\u7528\u3059\u308b<\/h3>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u306f\u3001<code>gettype()<\/code>\u95a2\u6570\u3084<code>instanceof<\/code>\u6f14\u7b97\u5b50\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u5909\u6570\u306e\u578b\u306b\u57fa\u3065\u3044\u305f\u5206\u5c90\u51e6\u7406\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-84\">gettype()\u3068\u30de\u30c3\u30c1\u5f0f\u306e\u7d44\u307f\u5408\u308f\u305b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function describeVariable($var) {\n    return match (gettype($var)) {\n        'integer' =&gt; \"\u6574\u6570\u5024: $var\",\n        'double'  =&gt; \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570: $var\",\n        'string'  =&gt; \"\u6587\u5b57\u5217: \\\"$var\\\" (\u9577\u3055: \" . strlen($var) . \")\",\n        'array'   =&gt; \"\u914d\u5217: \" . count($var) . \"\u8981\u7d20\",\n        'object'  =&gt; \"\u30aa\u30d6\u30b8\u30a7\u30af\u30c8: \u30af\u30e9\u30b9 \" . get_class($var),\n        'NULL'    =&gt; \"NULL\u5024\",\n        'boolean' =&gt; \"\u8ad6\u7406\u5024: \" . ($var ? 'true' : 'false'),\n        'resource' =&gt; \"\u30ea\u30bd\u30fc\u30b9: \u30bf\u30a4\u30d7 \" . get_resource_type($var),\n        default    =&gt; \"\u305d\u306e\u4ed6\u306e\u578b: \" . gettype($var),\n    };\n}\n\necho describeVariable(42);            \/\/ \"\u6574\u6570\u5024: 42\"\necho describeVariable(3.14);          \/\/ \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570: 3.14\"\necho describeVariable(\"Hello\");       \/\/ \"\u6587\u5b57\u5217: \"Hello\" (\u9577\u3055: 5)\"\necho describeVariable([1, 2, 3]);     \/\/ \"\u914d\u5217: 3\u8981\u7d20\"\necho describeVariable(new stdClass); \/\/ \"\u30aa\u30d6\u30b8\u30a7\u30af\u30c8: \u30af\u30e9\u30b9 stdClass\"\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-85\">instanceof\u6f14\u7b97\u5b50\u3068\u30de\u30c3\u30c1\u5f0f\u306e\u7d44\u307f\u5408\u308f\u305b<\/h4>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u306f\u5f0f\u306e\u7d50\u679c\u306b\u57fa\u3065\u3044\u3066\u5206\u5c90\u3067\u304d\u308b\u305f\u3081\u3001<code>instanceof<\/code>\u6f14\u7b97\u5b50\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u975e\u5e38\u306b\u5f37\u529b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">interface Renderable {\n    public function render(): string;\n}\n\nclass HtmlElement implements Renderable {\n    public function render(): string {\n        return \"&lt;div&gt;HTML\u8981\u7d20&lt;\/div&gt;\";\n    }\n}\n\nclass JsonData implements Renderable {\n    public function render(): string {\n        return '{\"type\":\"json\"}';\n    }\n}\n\nclass TextContent {\n    public function __toString(): string {\n        return \"\u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\";\n    }\n}\n\nfunction formatOutput($data) {\n    \/\/ true\/false\u306e\u5f0f\u306e\u7d50\u679c\u3067\u30de\u30c3\u30c1\n    return match (true) {\n        $data instanceof HtmlElement =&gt; \"HTML\u3068\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0: \" . $data-&gt;render(),\n        $data instanceof JsonData =&gt; \"JSON\u3068\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0: \" . $data-&gt;render(),\n        $data instanceof Renderable =&gt; \"\u305d\u306e\u4ed6\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u53ef\u80fd\u30aa\u30d6\u30b8\u30a7\u30af\u30c8: \" . $data-&gt;render(),\n        $data instanceof TextContent =&gt; \"\u30c6\u30ad\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4: \" . $data,\n        is_string($data) =&gt; \"\u5358\u7d14\u306a\u6587\u5b57\u5217: \" . $data,\n        is_array($data) =&gt; \"\u914d\u5217\u30c7\u30fc\u30bf: \" . count($data) . \"\u8981\u7d20\",\n        default =&gt; \"\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u578b\u3067\u3059: \" . gettype($data),\n    };\n}\n\n$html = new HtmlElement();\n$json = new JsonData();\n$text = new TextContent();\n$string = \"Hello World\";\n$array = [1, 2, 3];\n\necho formatOutput($html);   \/\/ \"HTML\u3068\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0: &lt;div&gt;HTML\u8981\u7d20&lt;\/div&gt;\"\necho formatOutput($json);   \/\/ \"JSON\u3068\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0: {\"type\":\"json\"}\"\necho formatOutput($text);   \/\/ \"\u30c6\u30ad\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4: \u30d7\u30ec\u30fc\u30f3\u30c6\u30ad\u30b9\u30c8\"\necho formatOutput($string); \/\/ \"\u5358\u7d14\u306a\u6587\u5b57\u5217: Hello World\"\necho formatOutput($array);  \/\/ \"\u914d\u5217\u30c7\u30fc\u30bf: 3\u8981\u7d20\"\n<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001<code>match (true)<\/code>\u3068\u3044\u3046\u7279\u6b8a\u306a\u66f8\u304d\u65b9\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u6761\u4ef6\u5f0f\u306e\u7d50\u679c\uff08true\/false\uff09\u306b\u57fa\u3065\u3044\u3066\u30de\u30c3\u30c1\u30f3\u30b0\u51e6\u7406\u3092\u884c\u3048\u307e\u3059\u3002\u6700\u521d\u306btrue\u3092\u8fd4\u3059\u6761\u4ef6\u306b\u5bfe\u5fdc\u3059\u308b\u5024\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-86\">\u30de\u30c3\u30c1\u5f0f\u306e\u8907\u6570\u6761\u4ef6\u3078\u306e\u5bfe\u5fdc<\/h3>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u3067\u306f\u3001\u8907\u6570\u306e\u5024\u3092\u4e00\u3064\u306e\u7d50\u679c\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getTypeCategory($var) {\n    return match (gettype($var)) {\n        'integer', 'double', 'boolean' =&gt; \"\u6570\u5024\u307e\u305f\u306f\u8ad6\u7406\u578b\",\n        'string' =&gt; \"\u6587\u5b57\u5217\u578b\",\n        'array', 'object' =&gt; \"\u8907\u5408\u578b\",\n        'NULL', 'resource', 'resource (closed)' =&gt; \"\u7279\u6b8a\u578b\",\n        default =&gt; \"\u672a\u77e5\u306e\u578b\",\n    };\n}\n\necho getTypeCategory(42);        \/\/ \"\u6570\u5024\u307e\u305f\u306f\u8ad6\u7406\u578b\"\necho getTypeCategory(3.14);      \/\/ \"\u6570\u5024\u307e\u305f\u306f\u8ad6\u7406\u578b\"\necho getTypeCategory(true);      \/\/ \"\u6570\u5024\u307e\u305f\u306f\u8ad6\u7406\u578b\"\necho getTypeCategory(\"Hello\");   \/\/ \"\u6587\u5b57\u5217\u578b\"\necho getTypeCategory([1, 2, 3]); \/\/ \"\u8907\u5408\u578b\"\necho getTypeCategory(null);      \/\/ \"\u7279\u6b8a\u578b\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-87\">\u6761\u4ef6\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u30de\u30c3\u30c1\u5f0f<\/h3>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u306f\u578b\u3060\u3051\u3067\u306a\u304f\u3001\u5024\u3082\u540c\u6642\u306b\u8003\u616e\u3057\u305f\u5206\u5c90\u51e6\u7406\u304c\u53ef\u80fd\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function describeNumber($num) {\n    return match (true) {\n        !is_numeric($num) =&gt; \"\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\",\n        $num === 0 =&gt; \"\u30bc\u30ed\u3067\u3059\",\n        $num &gt; 0 &amp;&amp; is_int($num) =&gt; \"\u6b63\u306e\u6574\u6570\u3067\u3059\",\n        $num &lt; 0 &amp;&amp; is_int($num) =&gt; \"\u8ca0\u306e\u6574\u6570\u3067\u3059\",\n        $num &gt; 0 =&gt; \"\u6b63\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\",\n        $num &lt; 0 =&gt; \"\u8ca0\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\",\n        default =&gt; \"\u4e88\u671f\u3057\u306a\u3044\u6570\u5024\u3067\u3059\",\n    };\n}\n\necho describeNumber(5);     \/\/ \"\u6b63\u306e\u6574\u6570\u3067\u3059\"\necho describeNumber(-10);   \/\/ \"\u8ca0\u306e\u6574\u6570\u3067\u3059\"\necho describeNumber(3.14);  \/\/ \"\u6b63\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\"\necho describeNumber(-0.5);  \/\/ \"\u8ca0\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\"\necho describeNumber(0);     \/\/ \"\u30bc\u30ed\u3067\u3059\"\necho describeNumber(\"abc\"); \/\/ \"\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-88\">PHP 8.1\u306e\u30de\u30c3\u30c1\u5f0f\u306e\u62e1\u5f35<\/h3>\n\n\n\n<p>PHP 8.1\u3067\u306f\u3001\u30de\u30c3\u30c1\u5f0f\u304c\u3055\u3089\u306b\u5f37\u5316\u3055\u308c\u3001<code>null<\/code>\u3068<code>false<\/code>\u3092\u72ec\u7acb\u3057\u305f\u578b\u3068\u3057\u3066\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 8.1\u4ee5\u964d\nfunction checkValue($value) {\n    return match ($value) {\n        null =&gt; \"NULL\u5024\u3067\u3059\",\n        false =&gt; \"FALSE\u5024\u3067\u3059\",\n        true =&gt; \"TRUE\u5024\u3067\u3059\",\n        default =&gt; \"\u305d\u306e\u4ed6\u306e\u5024\u3067\u3059\",\n    };\n}\n\nvar_dump(checkValue(null));   \/\/ \"NULL\u5024\u3067\u3059\"\nvar_dump(checkValue(false));  \/\/ \"FALSE\u5024\u3067\u3059\"\nvar_dump(checkValue(true));   \/\/ \"TRUE\u5024\u3067\u3059\"\nvar_dump(checkValue(0));      \/\/ \"\u305d\u306e\u4ed6\u306e\u5024\u3067\u3059\" (0\u306ffalse\u3068\u7b49\u4fa1\u3060\u304c\u3001===\u3067\u306f\u4e00\u81f4\u3057\u306a\u3044)\nvar_dump(checkValue(\"\"));     \/\/ \"\u305d\u306e\u4ed6\u306e\u5024\u3067\u3059\" (\u7a7a\u6587\u5b57\u5217\u306ffalse\u3068\u7b49\u4fa1\u3060\u304c\u3001===\u3067\u306f\u4e00\u81f4\u3057\u306a\u3044)\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-89\">\u30de\u30c3\u30c1\u5f0f\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>switch\u6587\u3088\u308a\u3082\u512a\u5148\u3059\u308b<\/strong>\uff1a\u578b\u306e\u5b89\u5168\u6027\u3068\u7c21\u6f54\u3055\u306e\u89b3\u70b9\u304b\u3089\u3001\u65b0\u3057\u3044\u30b3\u30fc\u30c9\u3067\u306fswitch\u6587\u3088\u308a\u3082\u30de\u30c3\u30c1\u5f0f\u3092\u512a\u5148\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>default\u30b1\u30fc\u30b9\u3092\u9069\u5207\u306b\u51e6\u7406\u3059\u308b<\/strong>\uff1a\u30de\u30c3\u30c1\u3059\u308b\u6761\u4ef6\u304c\u306a\u3044\u5834\u5408\u3001UnhandledMatchError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\u305f\u3081\u3001\u7279\u306b\u52d5\u7684\u306a\u5024\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306f<code>default<\/code>\u53e5\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30de\u30c3\u30c1\u5f0f\u306e\u5024\u3092\u5909\u6570\u306b\u4ee3\u5165\u3059\u308b<\/strong>\uff1a\u30de\u30c3\u30c1\u5f0f\u306f\u5024\u3092\u8fd4\u3059\u306e\u3067\u3001\u76f4\u63a5\u5909\u6570\u306b\u4ee3\u5165\u3057\u305f\u308a\u3001\u95a2\u6570\u306e\u623b\u308a\u5024\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$message = match ($statusCode) {\n    200 =&gt; \"OK\",\n    404 =&gt; \"Not Found\",\n    default =&gt; \"Unknown Status\",\n};\n\nreturn match ($type) {\n    'user' =&gt; processUser($data),\n    'order' =&gt; processOrder($data),\n    default =&gt; throw new InvalidArgumentException(\"Unsupported type: $type\"),\n};\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u8907\u96d1\u306a\u6761\u4ef6\u306ftrue\u3092\u4f7f\u7528\u3059\u308b<\/strong>\uff1a\u8907\u96d1\u306a\u6761\u4ef6\u306f\u3001<code>match (true)<\/code>\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5f0f\u306e\u7d50\u679c\u3092\u305d\u306e\u307e\u307e\u4f7f\u7528\u3059\u308b<\/strong>\uff1a\u30de\u30c3\u30c1\u5f0f\u306e\u7d50\u679c\u3092\u76f4\u63a5\u4f7f\u7528\u3067\u304d\u308b\u3053\u3068\u3092\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">echo match ($status) {\n    'active' =&gt; renderActiveUser($user),\n    'inactive' =&gt; renderInactiveUser($user),\n    default =&gt; renderUnknownStatus($user),\n};\n<\/pre>\n\n\n\n<p>\u30de\u30c3\u30c1\u5f0f\u306f\u3001PHP 8\u3067\u5c0e\u5165\u3055\u308c\u305f\u7d20\u6674\u3089\u3057\u3044\u6a5f\u80fd\u306e\u4e00\u3064\u3067\u3042\u308a\u3001\u7279\u306b\u578b\u306b\u57fa\u3065\u3044\u305f\u5206\u5c90\u51e6\u7406\u3092\u3088\u308a\u7c21\u6f54\u304b\u3064\u5b89\u5168\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u5f93\u6765\u306eswitch\u6587\u3068\u6bd4\u8f03\u3057\u3066\u3001\u3088\u308a\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3068\u7c21\u6f54\u306a\u69cb\u6587\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u3001\u30e2\u30c0\u30f3\u306aPHP\u30b3\u30fc\u30c9\u3067\u306f\u7a4d\u6975\u7684\u306b\u6d3b\u7528\u3059\u3079\u304d\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-90\">switch\u6587\u3088\u308a\u3082\u76f4\u611f\u7684\u306amatch\u5f0f\u3067\u306e\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p>PHP 8\u3067\u5c0e\u5165\u3055\u308c\u305fmatch\u5f0f\u306f\u3001\u5f93\u6765\u306eswitch\u6587\u3068\u6bd4\u8f03\u3057\u3066\u3001\u3088\u308a\u76f4\u611f\u7684\u3067\u5b89\u5168\u306a\u578b\u306b\u57fa\u3065\u304f\u6761\u4ef6\u5206\u5c90\u51e6\u7406\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001match\u5f0f\u3092\u4f7f\u3063\u3066\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u3092\u52b9\u679c\u7684\u306b\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-91\">switch\u6587\u306e\u5236\u9650\u3068\u554f\u984c\u70b9<\/h4>\n\n\n\n<p>\u307e\u305a\u3001\u5f93\u6765\u306eswitch\u6587\u304c\u6301\u3064\u5236\u9650\u3068\u554f\u984c\u70b9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u7de9\u3084\u304b\u306a\u6bd4\u8f03\uff08==\uff09<\/strong>: switch\u6587\u306f<code>==<\/code>\u6f14\u7b97\u5b50\u306b\u3088\u308b\u6bd4\u8f03\u3092\u884c\u3046\u305f\u3081\u3001\u578b\u5909\u63db\u306b\u3088\u308b\u4e88\u671f\u3057\u306a\u3044\u4e00\u81f4\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30d5\u30a9\u30fc\u30eb\u30b9\u30eb\u30fc<\/strong>: break\u3092\u5fd8\u308c\u308b\u3068\u6b21\u306ecase\u306e\u51e6\u7406\u3082\u5b9f\u884c\u3055\u308c\u307e\u3059\uff08\u3053\u308c\u304c\u610f\u56f3\u7684\u306b\u5229\u7528\u3055\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u591a\u304f\u306e\u5834\u5408\u306f\u30d0\u30b0\u306e\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\uff09\u3002<\/li>\n\n\n\n<li><strong>\u5197\u9577\u306a\u69cb\u6587<\/strong>: \u5404case\u306bbreak\u3092\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u30b3\u30fc\u30c9\u304c\u5197\u9577\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5f0f\u3068\u3057\u3066\u306e\u4f7f\u7528\u4e0d\u53ef<\/strong>: switch\u6587\u306f\u5024\u3092\u8fd4\u3059\u5f0f\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u5909\u6570\u306b\u76f4\u63a5\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u793a\u3059switch\u6587\u306e\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u306e\u7de9\u3084\u304b\u306a\u6bd4\u8f03\u306b\u3088\u308b\u4e88\u671f\u3057\u306a\u3044\u52d5\u4f5c\n$value = \"1\";  \/\/ \u6587\u5b57\u5217\u306e \"1\"\nswitch ($value) {\n    case 1:  \/\/ \u6574\u6570\u306e 1 \u3068\u6bd4\u8f03\n        echo \"\u6574\u6570\u306e1\u3067\u3059\";\n        break;\n    case \"1\":  \/\/ \u6587\u5b57\u5217\u306e \"1\" \u3068\u6bd4\u8f03\n        echo \"\u6587\u5b57\u5217\u306e\\\"1\\\"\u3067\u3059\";\n        break;\n}\n\/\/ \u51fa\u529b: \"\u6574\u6570\u306e1\u3067\u3059\" (\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c)\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-92\">match\u5f0f\u306e\u57fa\u672c\u7684\u306a\u69cb\u6587\u3068\u7279\u5fb4<\/h4>\n\n\n\n<p>match\u5f0f\u306f\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3001\u3088\u308a\u7c21\u6f54\u3067\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ match\u5f0f\u306e\u57fa\u672c\u69cb\u6587\n$result = match ($value) {\n    $condition1 =&gt; $result1,\n    $condition2 =&gt; $result2,\n    default =&gt; $defaultResult,\n};\n<\/pre>\n\n\n\n<p>match\u5f0f\u306e\u4e3b\u306a\u7279\u5fb4\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u306a\u6bd4\u8f03\uff08===\uff09<\/strong>: \u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u305f\u3081\u3001\u578b\u306e\u4e0d\u4e00\u81f4\u306b\u3088\u308b\u30d0\u30b0\u3092\u9632\u304e\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u81ea\u52d5break<\/strong>: \u5404\u6761\u4ef6\u306b\u5bfe\u3057\u3066\u4e00\u3064\u306e\u7d50\u679c\u3060\u3051\u304c\u5b9f\u884c\u3055\u308c\u3001\u30d5\u30a9\u30fc\u30eb\u30b9\u30eb\u30fc\u306e\u5fc3\u914d\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n\n\n\n<li><strong>\u7c21\u6f54\u306a\u69cb\u6587<\/strong>: \u77e2\u5370\uff08=&gt;\uff09\u3092\u4f7f\u7528\u3057\u3066\u6761\u4ef6\u3068\u7d50\u679c\u3092\u76f4\u63a5\u30de\u30c3\u30d4\u30f3\u30b0\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5f0f\u3068\u3057\u3066\u306e\u4f7f\u7528<\/strong>: \u5024\u3092\u8fd4\u3059\u5f0f\u3068\u3057\u3066\u4f7f\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u5909\u6570\u306b\u76f4\u63a5\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u4f8b\u5916\u767a\u751f<\/strong>: \u30de\u30c3\u30c1\u3059\u308b\u6761\u4ef6\u304c\u306a\u3044\u5834\u5408\u3001UnhandledMatchError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u5148\u307b\u3069\u306eswitch\u6587\u306e\u4f8b\u3092match\u5f0f\u3067\u66f8\u304d\u76f4\u3059\u3068\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$value = \"1\";  \/\/ \u6587\u5b57\u5217\u306e \"1\"\n$result = match ($value) {\n    1 =&gt; \"\u6574\u6570\u306e1\u3067\u3059\",\n    \"1\" =&gt; \"\u6587\u5b57\u5217\u306e\\\"1\\\"\u3067\u3059\",\n    default =&gt; \"\u305d\u306e\u4ed6\u306e\u5024\u3067\u3059\",\n};\necho $result;\n\/\/ \u51fa\u529b: \"\u6587\u5b57\u5217\u306e\\\"1\\\"\u3067\u3059\" (\u671f\u5f85\u901a\u308a\u306e\u7d50\u679c)\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-93\">\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u3067\u306ematch\u5f0f\u306e\u4f7f\u7528<\/h4>\n\n\n\n<p>match\u5f0f\u306f\u7279\u306b\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<code>gettype()<\/code>\u95a2\u6570\u3084<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u76f4\u611f\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>gettype()\u3068match\u5f0f\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getTypeDescription($var) {\n    return match (gettype($var)) {\n        'integer' =&gt; '\u6574\u6570\u578b\u3067\u3059',\n        'double' =&gt; '\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3059',\n        'string' =&gt; '\u6587\u5b57\u5217\u578b\u3067\u3059',\n        'array' =&gt; '\u914d\u5217\u578b\u3067\u3059',\n        'object' =&gt; '\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u578b\u3067\u3059',\n        'NULL' =&gt; 'NULL\u5024\u3067\u3059',\n        'boolean' =&gt; '\u8ad6\u7406\u578b\u3067\u3059',\n        'resource' =&gt; '\u30ea\u30bd\u30fc\u30b9\u578b\u3067\u3059',\n        default =&gt; '\u672a\u77e5\u306e\u578b\u3067\u3059',\n    };\n}\n\necho getTypeDescription(42);        \/\/ \u6574\u6570\u578b\u3067\u3059\necho getTypeDescription(3.14);      \/\/ \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3059\necho getTypeDescription(\"Hello\");   \/\/ \u6587\u5b57\u5217\u578b\u3067\u3059\necho getTypeDescription([1, 2, 3]); \/\/ \u914d\u5217\u578b\u3067\u3059\n<\/pre>\n\n\n\n<p>\u540c\u7b49\u306e\u51e6\u7406\u3092switch\u6587\u3067\u66f8\u304f\u3068\u3001\u3088\u308a\u5197\u9577\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getTypeDescriptionWithSwitch($var) {\n    switch (gettype($var)) {\n        case 'integer':\n            return '\u6574\u6570\u578b\u3067\u3059';\n        case 'double':\n            return '\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3067\u3059';\n        case 'string':\n            return '\u6587\u5b57\u5217\u578b\u3067\u3059';\n        case 'array':\n            return '\u914d\u5217\u578b\u3067\u3059';\n        case 'object':\n            return '\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u578b\u3067\u3059';\n        case 'NULL':\n            return 'NULL\u5024\u3067\u3059';\n        case 'boolean':\n            return '\u8ad6\u7406\u578b\u3067\u3059';\n        case 'resource':\n            return '\u30ea\u30bd\u30fc\u30b9\u578b\u3067\u3059';\n        default:\n            return '\u672a\u77e5\u306e\u578b\u3067\u3059';\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-94\">\u8907\u96d1\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u7c21\u6f54\u306b\u3059\u308b\u65b9\u6cd5<\/h4>\n\n\n\n<p>match\u5f0f\u306e\u771f\u306e\u529b\u306f\u3001<code>match (true)<\/code>\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u8907\u96d1\u306a\u6761\u4ef6\u3092\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u308b\u70b9\u306b\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function describeValue($value) {\n    return match (true) {\n        is_int($value) &amp;&amp; $value &gt; 0 =&gt; '\u6b63\u306e\u6574\u6570\u3067\u3059',\n        is_int($value) &amp;&amp; $value &lt; 0 =&gt; '\u8ca0\u306e\u6574\u6570\u3067\u3059',\n        is_int($value) =&gt; '\u30bc\u30ed\u3067\u3059',\n        is_float($value) =&gt; '\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059',\n        is_string($value) &amp;&amp; ctype_alpha($value) =&gt; '\u6587\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059',\n        is_string($value) &amp;&amp; ctype_digit($value) =&gt; '\u6570\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059',\n        is_string($value) =&gt; '\u6587\u5b57\u5217\u3067\u3059',\n        is_array($value) &amp;&amp; count($value) === 0 =&gt; '\u7a7a\u306e\u914d\u5217\u3067\u3059',\n        is_array($value) =&gt; count($value) . '\u8981\u7d20\u306e\u914d\u5217\u3067\u3059',\n        $value === null =&gt; 'NULL\u5024\u3067\u3059',\n        is_bool($value) =&gt; $value ? 'TRUE\u5024\u3067\u3059' : 'FALSE\u5024\u3067\u3059',\n        default =&gt; '\u5206\u985e\u4e0d\u80fd\u306a\u5024\u3067\u3059',\n    };\n}\n\necho describeValue(42);        \/\/ \u6b63\u306e\u6574\u6570\u3067\u3059\necho describeValue(-10);       \/\/ \u8ca0\u306e\u6574\u6570\u3067\u3059\necho describeValue(0);         \/\/ \u30bc\u30ed\u3067\u3059\necho describeValue(3.14);      \/\/ \u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\necho describeValue(\"abc\");     \/\/ \u6587\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059\necho describeValue(\"123\");     \/\/ \u6570\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059\necho describeValue(\"abc123\");  \/\/ \u6587\u5b57\u5217\u3067\u3059\necho describeValue([]);        \/\/ \u7a7a\u306e\u914d\u5217\u3067\u3059\necho describeValue([1, 2, 3]); \/\/ 3\u8981\u7d20\u306e\u914d\u5217\u3067\u3059\necho describeValue(null);      \/\/ NULL\u5024\u3067\u3059\necho describeValue(true);      \/\/ TRUE\u5024\u3067\u3059\necho describeValue(false);     \/\/ FALSE\u5024\u3067\u3059\n<\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001<code>match (true)<\/code>\u3092\u4f7f\u7528\u3057\u3066\u3001\u6700\u521d\u306b<code>true<\/code>\u3092\u8fd4\u3059\u6761\u4ef6\u306b\u5bfe\u5fdc\u3059\u308b\u7d50\u679c\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u8907\u96d1\u306a\u6761\u4ef6\u3092\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-95\">\u5b9f\u969b\u306e\u958b\u767a\u30b7\u30fc\u30f3\u3067\u306e\u6d3b\u7528\u4f8b<\/h4>\n\n\n\n<p>API\u5fdc\u7b54\u306e\u51e6\u7406\u3084\u3001\u5165\u529b\u5024\u306e\u691c\u8a3c\u306a\u3069\u3001\u5b9f\u969b\u306e\u958b\u767a\u30b7\u30fc\u30f3\u3067\u3082match\u5f0f\u306f\u975e\u5e38\u306b\u6709\u7528\u3067\u3059\uff1a<\/p>\n\n\n\n<p><strong>API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function handleApiResponse($response) {\n    return match (true) {\n        \/\/ \u6210\u529f\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406\n        isset($response['data']) &amp;&amp; is_array($response['data']) =&gt; processData($response['data']),\n        \n        \/\/ \u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406\n        isset($response['error']) &amp;&amp; is_string($response['error']) =&gt; handleError($response['error']),\n        \n        \/\/ \u30ec\u30fc\u30c8\u5236\u9650\u30a8\u30e9\u30fc\u306e\u7279\u5225\u51e6\u7406\n        isset($response['status']) &amp;&amp; $response['status'] === 429 =&gt; handleRateLimitExceeded(),\n        \n        \/\/ \u305d\u306e\u4ed6\u306e\u30a8\u30e9\u30fc\u30b1\u30fc\u30b9\n        isset($response['status']) &amp;&amp; $response['status'] &gt;= 400 =&gt; handleHttpError($response['status']),\n        \n        \/\/ \u4e88\u671f\u3057\u306a\u3044\u30ec\u30b9\u30dd\u30f3\u30b9\u5f62\u5f0f\n        default =&gt; throw new InvalidArgumentException('\u7121\u52b9\u306aAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u5f62\u5f0f\u3067\u3059'),\n    };\n}\n<\/pre>\n\n\n\n<p><strong>\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u5024\u306e\u691c\u8a3c<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function validateInput($fieldName, $value) {\n    return match ($fieldName) {\n        'email' =&gt; filter_var($value, FILTER_VALIDATE_EMAIL) \n            ? $value \n            : throw new InvalidArgumentException('\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n            \n        'age' =&gt; is_numeric($value) &amp;&amp; $value &gt;= 18 \n            ? (int)$value \n            : throw new InvalidArgumentException('\u5e74\u9f62\u306f18\u4ee5\u4e0a\u306e\u6570\u5024\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n            \n        'username' =&gt; is_string($value) &amp;&amp; strlen($value) &gt;= 3 \n            ? $value \n            : throw new InvalidArgumentException('\u30e6\u30fc\u30b6\u30fc\u540d\u306f3\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n            \n        'password' =&gt; is_string($value) &amp;&amp; strlen($value) &gt;= 8 \n            ? $value \n            : throw new InvalidArgumentException('\u30d1\u30b9\u30ef\u30fc\u30c9\u306f8\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n            \n        default =&gt; throw new InvalidArgumentException(\"\u672a\u77e5\u306e\u30d5\u30a3\u30fc\u30eb\u30c9: {$fieldName}\"),\n    };\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-96\">match\u5f0f\u4f7f\u7528\u6642\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u8907\u6570\u6761\u4ef6\u306e\u30b0\u30eb\u30fc\u30d7\u5316<\/strong>\uff1a\u8907\u6570\u306e\u6761\u4ef6\u3067\u540c\u3058\u7d50\u679c\u3092\u8fd4\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\u3067\u533a\u5207\u3063\u3066\u6761\u4ef6\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$category = match (gettype($value)) {\n    'integer', 'double', 'boolean' =&gt; '\u57fa\u672c\u578b',\n    'string' =&gt; '\u6587\u5b57\u5217\u578b',\n    'array', 'object' =&gt; '\u8907\u5408\u578b',\n    default =&gt; '\u305d\u306e\u4ed6\u306e\u578b',\n};\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u5f0f\u3092\u8a55\u4fa1\u3057\u305f\u7d50\u679c\u3092\u4f7f\u7528<\/strong>\uff1amatch\u5f0f\u306f\u5f0f\u306e\u8a55\u4fa1\u7d50\u679c\u3092\u4f7f\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u8907\u96d1\u306a\u6761\u4ef6\u3082\u7c21\u6f54\u306b\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$message = match (strlen($username)) {\n    0 =&gt; '\u30e6\u30fc\u30b6\u30fc\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044',\n    1, 2 =&gt; '\u30e6\u30fc\u30b6\u30fc\u540d\u306f3\u6587\u5b57\u4ee5\u4e0a\u306b\u3057\u3066\u304f\u3060\u3055\u3044',\n    default =&gt; \"\u3088\u3046\u3053\u305d\u3001{$username}\u3055\u3093\",\n};\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u4f8b\u5916\u306e\u30b9\u30ed\u30fc<\/strong>\uff1a\u6761\u4ef6\u306b\u5408\u308f\u306a\u3044\u5834\u5408\u306b\u4f8b\u5916\u3092\u30b9\u30ed\u30fc\u3059\u308b\u3053\u3068\u3067\u3001\u7121\u52b9\u306a\u5165\u529b\u306b\u5bfe\u3057\u3066\u660e\u78ba\u306a\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u63d0\u4f9b\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$validatedAge = match (true) {\n    !is_numeric($age) =&gt; throw new InvalidArgumentException('\u5e74\u9f62\u306f\u6570\u5024\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n    $age &lt; 0 =&gt; throw new InvalidArgumentException('\u5e74\u9f62\u306f0\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n    $age &gt; 120 =&gt; throw new InvalidArgumentException('\u6709\u52b9\u306a\u5e74\u9f62\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n    default =&gt; (int)$age,\n};\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>default\u30b1\u30fc\u30b9\u306e\u9069\u5207\u306a\u4f7f\u7528<\/strong>\uff1a\u672a\u51e6\u7406\u306e\u6761\u4ef6\u304c\u3042\u308b\u5834\u5408\u306bUnhandledMatchError\u304c\u30b9\u30ed\u30fc\u3055\u308c\u308b\u305f\u3081\u3001\u7279\u306b\u52d5\u7684\u306a\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5834\u5408\u306f<code>default<\/code>\u53e5\u3092\u542b\u3081\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>match\u5f0f\u306f\u3001PHP 8\u306b\u304a\u3051\u308b\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u3092\u5927\u5e45\u306b\u7c21\u7d20\u5316\u3057\u3001\u3088\u308a\u5b89\u5168\u3067\u8aad\u307f\u3084\u3059\u3044\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002\u5f93\u6765\u306eswitch\u6587\u3068\u6bd4\u8f03\u3057\u3066\u3001\u305d\u306e\u7c21\u6f54\u3055\u3068\u578b\u5b89\u5168\u6027\u306e\u5229\u70b9\u306f\u660e\u3089\u304b\u3067\u3059\u3002\u7279\u306b\u8907\u96d1\u306a\u578b\u5224\u5b9a\u3084\u6761\u4ef6\u5206\u5c90\u3092\u5fc5\u8981\u3068\u3059\u308b\u30b3\u30fc\u30c9\u3067\u306f\u3001match\u5f0f\u306e\u5c0e\u5165\u3092\u7a4d\u6975\u7684\u306b\u691c\u8a0e\u3059\u3079\u304d\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-97\">\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u4f8b<\/h3>\n\n\n\n<p>PHP\u306ematch\u5f0f\u306e\u6700\u3082\u5f37\u529b\u306a\u6d3b\u7528\u65b9\u6cd5\u306e\u4e00\u3064\u304c\u3001\u5909\u6570\u306e\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u540c\u6642\u306b\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u3067\u3059\u3002\u3053\u306e\u624b\u6cd5\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u5f93\u6765\u306e\u65b9\u6cd5\u3088\u308a\u3082\u7c21\u6f54\u3067\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u5b9f\u8df5\u7684\u306a\u30b7\u30ca\u30ea\u30aa\u306b\u304a\u3044\u3066\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306e\u5b9f\u88c5\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-98\">\u57fa\u672c\u7684\u306a\u30d1\u30bf\u30fc\u30f3: \u578b\u3068\u5024\u306e\u540c\u6642\u30c1\u30a7\u30c3\u30af<\/h4>\n\n\n\n<p>\u6700\u3082\u5358\u7d14\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u3001<code>match (true)<\/code>\u3092\u4f7f\u7528\u3057\u3066\u3001\u578b\u30c1\u30a7\u30c3\u30af\u95a2\u6570\u3068\u5024\u306e\u30c1\u30a7\u30c3\u30af\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function analyzeValue($value) {\n    return match (true) {\n        \/\/ \u6574\u6570\u5024\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\n        is_int($value) &amp;&amp; $value === 0 =&gt; \"\u6574\u6570\u306e\u30bc\u30ed\u3067\u3059\",\n        is_int($value) &amp;&amp; $value &gt; 0 =&gt; \"\u6b63\u306e\u6574\u6570\u3067\u3059: $value\",\n        is_int($value) &amp;&amp; $value &lt; 0 =&gt; \"\u8ca0\u306e\u6574\u6570\u3067\u3059: $value\",\n        \n        \/\/ \u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\n        is_float($value) &amp;&amp; $value === 0.0 =&gt; \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306e\u30bc\u30ed\u3067\u3059\",\n        is_float($value) &amp;&amp; $value &gt; 0 =&gt; \"\u6b63\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059: $value\",\n        is_float($value) &amp;&amp; $value &lt; 0 =&gt; \"\u8ca0\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059: $value\",\n        \n        \/\/ \u6587\u5b57\u5217\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\n        is_string($value) &amp;&amp; $value === \"\" =&gt; \"\u7a7a\u6587\u5b57\u5217\u3067\u3059\",\n        is_string($value) &amp;&amp; ctype_digit($value) =&gt; \"\u6570\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059: \\\"$value\\\"\",\n        is_string($value) &amp;&amp; ctype_alpha($value) =&gt; \"\u82f1\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059: \\\"$value\\\"\",\n        is_string($value) =&gt; \"\u6587\u5b57\u5217\u3067\u3059: \\\"$value\\\"\",\n        \n        \/\/ \u914d\u5217\u306e\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\n        is_array($value) &amp;&amp; count($value) === 0 =&gt; \"\u7a7a\u306e\u914d\u5217\u3067\u3059\",\n        is_array($value) &amp;&amp; array_keys($value) === range(0, count($value) - 1) =&gt; \"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u914d\u5217\u3067\u3059\uff08\" . count($value) . \"\u8981\u7d20\uff09\",\n        is_array($value) =&gt; \"\u9023\u60f3\u914d\u5217\u3067\u3059\uff08\" . count($value) . \"\u8981\u7d20\uff09\",\n        \n        \/\/ \u8ad6\u7406\u5024\u3068 NULL\n        is_bool($value) &amp;&amp; $value === true =&gt; \"TRUE\u5024\u3067\u3059\",\n        is_bool($value) &amp;&amp; $value === false =&gt; \"FALSE\u5024\u3067\u3059\",\n        is_null($value) =&gt; \"NULL\u5024\u3067\u3059\",\n        \n        \/\/ \u305d\u306e\u4ed6\u306e\u578b\n        default =&gt; \"\u305d\u306e\u4ed6\u306e\u578b\u307e\u305f\u306f\u5024\u3067\u3059: \" . gettype($value),\n    };\n}\n\n\/\/ \u4f7f\u7528\u4f8b\necho analyzeValue(0);        \/\/ \"\u6574\u6570\u306e\u30bc\u30ed\u3067\u3059\"\necho analyzeValue(42);       \/\/ \"\u6b63\u306e\u6574\u6570\u3067\u3059: 42\"\necho analyzeValue(-3.14);    \/\/ \"\u8ca0\u306e\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059: -3.14\"\necho analyzeValue(\"\");       \/\/ \"\u7a7a\u6587\u5b57\u5217\u3067\u3059\"\necho analyzeValue(\"12345\");  \/\/ \"\u6570\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059: \"12345\"\"\necho analyzeValue(\"Hello\");  \/\/ \"\u82f1\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u3067\u3059: \"Hello\"\"\necho analyzeValue([]);       \/\/ \"\u7a7a\u306e\u914d\u5217\u3067\u3059\"\necho analyzeValue([1,2,3]);  \/\/ \"\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u914d\u5217\u3067\u3059\uff083\u8981\u7d20\uff09\"\necho analyzeValue([\"a\"=&gt;1]); \/\/ \"\u9023\u60f3\u914d\u5217\u3067\u3059\uff081\u8981\u7d20\uff09\"\necho analyzeValue(true);     \/\/ \"TRUE\u5024\u3067\u3059\"\necho analyzeValue(null);     \/\/ \"NULL\u5024\u3067\u3059\"\n<\/pre>\n\n\n\n<p>\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u306f\u3001\u578b\u30c1\u30a7\u30c3\u30af\u95a2\u6570\uff08<code>is_int<\/code>\u3001<code>is_string<\/code>\u306a\u3069\uff09\u3068\u5024\u306e\u6761\u4ef6\uff08<code>=== 0<\/code>\u3001<code>&gt; 0<\/code>\u306a\u3069\uff09\u3092\u8ad6\u7406\u6f14\u7b97\u5b50\uff08<code>&amp;&amp;<\/code>\uff09\u3067\u7d50\u5408\u3057\u3066\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-99\">\u5b9f\u8df5\u4f8b1: API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406<\/h4>\n\n\n\n<p>API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\u3059\u308b\u969b\u306b\u306f\u3001\u4e88\u671f\u3057\u306a\u3044\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002match\u5f0f\u3092\u4f7f\u7528\u3057\u3066\u3001\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u306a\u51e6\u7406\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function processApiResponse($response) {\n    return match (true) {\n        \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u304cnull\u306e\u5834\u5408\uff08API\u304c\u5fdc\u7b54\u3057\u306a\u3044\uff09\n        is_null($response) =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; 'API\u304b\u3089\u306e\u5fdc\u7b54\u304c\u3042\u308a\u307e\u305b\u3093',\n            'data' =&gt; null\n        ],\n        \n        \/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u914d\u5217\u3067\u306f\u306a\u3044\u5834\u5408\n        !is_array($response) =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; '\u7121\u52b9\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u5f62\u5f0f\u3067\u3059: ' . gettype($response),\n            'data' =&gt; null\n        ],\n        \n        \/\/ \u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u5834\u5408\n        isset($response['error']) &amp;&amp; is_string($response['error']) =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; $response['error'],\n            'data' =&gt; null\n        ],\n        \n        \/\/ \u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u304c\u5b58\u5728\u3057\u3001\u6210\u529f\u3092\u793a\u3055\u306a\u3044\u5834\u5408\n        isset($response['status']) &amp;&amp; is_int($response['status']) &amp;&amp; $response['status'] !== 200 =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; '\u5931\u6557\u3057\u305f\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9: ' . $response['status'],\n            'data' =&gt; $response['data'] ?? null\n        ],\n        \n        \/\/ \u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u304c\u914d\u5217\u3067\u306f\u306a\u3044\u5834\u5408\n        isset($response['data']) &amp;&amp; !is_array($response['data']) =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; '\u30c7\u30fc\u30bf\u304c\u914d\u5217\u5f62\u5f0f\u3067\u306f\u3042\u308a\u307e\u305b\u3093',\n            'data' =&gt; null\n        ],\n        \n        \/\/ \u6b63\u5e38\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u5834\u5408\n        isset($response['data']) &amp;&amp; is_array($response['data']) =&gt; [\n            'success' =&gt; true,\n            'message' =&gt; '\u6210\u529f',\n            'data' =&gt; $response['data']\n        ],\n        \n        \/\/ \u305d\u306e\u4ed6\u306e\u4e88\u671f\u3057\u306a\u3044\u5f62\u5f0f\u306e\u5834\u5408\n        default =&gt; [\n            'success' =&gt; false,\n            'message' =&gt; '\u4e0d\u660e\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u5f62\u5f0f\u3067\u3059',\n            'data' =&gt; null\n        ],\n    };\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$successResponse = ['status' =&gt; 200, 'data' =&gt; ['id' =&gt; 1, 'name' =&gt; 'Product']];\n$errorResponse = ['status' =&gt; 404, 'error' =&gt; 'Resource not found'];\n$invalidResponse = 'Service unavailable';\n\nvar_dump(processApiResponse($successResponse));\nvar_dump(processApiResponse($errorResponse));\nvar_dump(processApiResponse($invalidResponse));\nvar_dump(processApiResponse(null));\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-100\">\u5b9f\u8df5\u4f8b2: \u30d5\u30a9\u30fc\u30e0\u5165\u529b\u306e\u691c\u8a3c\u3068\u5909\u63db<\/h4>\n\n\n\n<p>\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u3092\u691c\u8a3c\u3057\u3001\u9069\u5207\u306a\u578b\u306b\u5909\u63db\u3059\u308b\u51e6\u7406\u3082\u3001\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3059\u308b\u5178\u578b\u7684\u306a\u30b1\u30fc\u30b9\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function validateAndConvertFormInput($fieldName, $value) {\n    return match (true) {\n        \/\/ \u540d\u524d\u30d5\u30a3\u30fc\u30eb\u30c9: \u7a7a\u3067\u306a\u304f\u3001\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\n        $fieldName === 'name' &amp;&amp; !is_string($value) =&gt; \n            throw new InvalidArgumentException('\u540d\u524d\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'name' &amp;&amp; is_string($value) &amp;&amp; trim($value) === '' =&gt; \n            throw new InvalidArgumentException('\u540d\u524d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n        $fieldName === 'name' &amp;&amp; is_string($value) =&gt; \n            trim($value),\n            \n        \/\/ \u5e74\u9f62\u30d5\u30a3\u30fc\u30eb\u30c9: \u6570\u5024\u306b\u5909\u63db\u53ef\u80fd\u3067\u3001\u9069\u5207\u306a\u7bc4\u56f2\u5185\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\n        $fieldName === 'age' &amp;&amp; is_string($value) &amp;&amp; !is_numeric($value) =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u306f\u6570\u5024\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'age' &amp;&amp; (is_numeric($value) &amp;&amp; (int)$value &lt; 18) =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u306f18\u6b73\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'age' &amp;&amp; (is_numeric($value) &amp;&amp; (int)$value &gt; 120) =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u304c\u7121\u52b9\u3067\u3059'),\n        $fieldName === 'age' &amp;&amp; is_numeric($value) =&gt; \n            (int)$value,\n            \n        \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9: \u6709\u52b9\u306a\u5f62\u5f0f\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\n        $fieldName === 'email' &amp;&amp; !is_string($value) =&gt; \n            throw new InvalidArgumentException('\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'email' &amp;&amp; is_string($value) &amp;&amp; !filter_var($value, FILTER_VALIDATE_EMAIL) =&gt; \n            throw new InvalidArgumentException('\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n        $fieldName === 'email' &amp;&amp; is_string($value) =&gt; \n            strtolower(trim($value)),\n            \n        \/\/ \u96fb\u8a71\u756a\u53f7: \u6570\u5b57\u306e\u307f\u306e\u6587\u5b57\u5217\u306b\u6574\u5f62\u3059\u308b\n        $fieldName === 'phone' &amp;&amp; !is_string($value) =&gt; \n            throw new InvalidArgumentException('\u96fb\u8a71\u756a\u53f7\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'phone' &amp;&amp; is_string($value) =&gt; \n            preg_replace('\/[^0-9]\/', '', $value),\n            \n        \/\/ \u8208\u5473\u306e\u3042\u308b\u30ab\u30c6\u30b4\u30ea: \u914d\u5217\u3067\u6307\u5b9a\u3055\u308c\u305f\u5024\u306e\u307f\u3092\u8a31\u53ef\u3059\u308b\n        $fieldName === 'interests' &amp;&amp; !is_array($value) =&gt; \n            throw new InvalidArgumentException('\u8208\u5473\u306e\u3042\u308b\u30ab\u30c6\u30b4\u30ea\u306f\u914d\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        $fieldName === 'interests' &amp;&amp; is_array($value) &amp;&amp; count($value) === 0 =&gt; \n            throw new InvalidArgumentException('\u5c11\u306a\u304f\u3068\u30821\u3064\u306e\u30ab\u30c6\u30b4\u30ea\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044'),\n        $fieldName === 'interests' &amp;&amp; is_array($value) =&gt; \n            array_intersect($value, ['sports', 'music', 'movies', 'books', 'technology']),\n            \n        \/\/ \u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\n        default =&gt; \n            throw new InvalidArgumentException(\"\u672a\u77e5\u306e\u30d5\u30a3\u30fc\u30eb\u30c9: {$fieldName}\"),\n    };\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ntry {\n    $name = validateAndConvertFormInput('name', '  John Doe  ');\n    $age = validateAndConvertFormInput('age', '25');\n    $email = validateAndConvertFormInput('email', 'john@example.com');\n    $phone = validateAndConvertFormInput('phone', '(123) 456-7890');\n    $interests = validateAndConvertFormInput('interests', ['music', 'technology']);\n    \n    echo \"\u691c\u8a3c\u6210\u529f: $name, $age\u6b73, $email, $phone\\n\";\n    echo \"\u8208\u5473: \" . implode(', ', $interests) . \"\\n\";\n} catch (InvalidArgumentException $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage() . \"\\n\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-101\">\u5b9f\u8df5\u4f8b3: \u52d5\u7684\u306a\u578b\u5909\u63db<\/h4>\n\n\n\n<p>\u30c7\u30fc\u30bf\u306e\u578b\u3092\u52d5\u7684\u306b\u5909\u63db\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u3001\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305fmatch\u5f0f\u304c\u975e\u5e38\u306b\u52b9\u679c\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function smartConvert($value, $targetType) {\n    return match (true) {\n        \/\/ null\u306e\u51e6\u7406\n        is_null($value) &amp;&amp; $targetType === 'string' =&gt; '',\n        is_null($value) &amp;&amp; $targetType === 'int' =&gt; 0,\n        is_null($value) &amp;&amp; $targetType === 'float' =&gt; 0.0,\n        is_null($value) &amp;&amp; $targetType === 'bool' =&gt; false,\n        is_null($value) &amp;&amp; $targetType === 'array' =&gt; [],\n        \n        \/\/ \u6587\u5b57\u5217\u3078\u306e\u5909\u63db\n        $targetType === 'string' &amp;&amp; is_scalar($value) =&gt; (string)$value,\n        $targetType === 'string' &amp;&amp; is_array($value) =&gt; json_encode($value),\n        $targetType === 'string' &amp;&amp; is_object($value) &amp;&amp; method_exists($value, '__toString') =&gt; (string)$value,\n        \n        \/\/ \u6574\u6570\u3078\u306e\u5909\u63db\n        $targetType === 'int' &amp;&amp; is_numeric($value) =&gt; (int)$value,\n        $targetType === 'int' &amp;&amp; is_bool($value) =&gt; $value ? 1 : 0,\n        $targetType === 'int' &amp;&amp; is_string($value) &amp;&amp; ctype_digit($value) =&gt; (int)$value,\n        \n        \/\/ \u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3078\u306e\u5909\u63db\n        $targetType === 'float' &amp;&amp; is_numeric($value) =&gt; (float)$value,\n        \n        \/\/ \u8ad6\u7406\u5024\u3078\u306e\u5909\u63db\n        $targetType === 'bool' &amp;&amp; is_numeric($value) =&gt; $value != 0,\n        $targetType === 'bool' &amp;&amp; is_string($value) =&gt; strtolower($value) === 'true' || $value === '1',\n        \n        \/\/ \u914d\u5217\u3078\u306e\u5909\u63db\n        $targetType === 'array' &amp;&amp; is_scalar($value) =&gt; [$value],\n        $targetType === 'array' &amp;&amp; is_object($value) =&gt; (array)$value,\n        \n        \/\/ \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u5909\u63db\n        $targetType === 'object' &amp;&amp; is_array($value) =&gt; (object)$value,\n        \n        \/\/ \u3059\u3067\u306b\u76ee\u7684\u306e\u578b\u3067\u3042\u308b\u5834\u5408\n        gettype($value) === $targetType =&gt; $value,\n        is_int($value) &amp;&amp; $targetType === 'integer' =&gt; $value,\n        is_float($value) &amp;&amp; $targetType === 'double' =&gt; $value,\n        \n        \/\/ \u5909\u63db\u3067\u304d\u306a\u3044\u5834\u5408\n        default =&gt; throw new InvalidArgumentException(\n            sprintf('\"%s\"\u578b\u304b\u3089\"%s\"\u578b\u3078\u306e\u5909\u63db\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093', gettype($value), $targetType)\n        ),\n    };\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$values = [\n    'nullToString' =&gt; smartConvert(null, 'string'),\n    'intToString' =&gt; smartConvert(42, 'string'),\n    'floatToString' =&gt; smartConvert(3.14, 'string'),\n    'arrayToString' =&gt; smartConvert([1, 2, 3], 'string'),\n    'stringToInt' =&gt; smartConvert(\"42\", 'int'),\n    'boolToInt' =&gt; smartConvert(true, 'int'),\n    'stringToBool' =&gt; smartConvert(\"true\", 'bool'),\n    'scalarToArray' =&gt; smartConvert(42, 'array'),\n    'arrayToObject' =&gt; smartConvert(['name' =&gt; 'John'], 'object'),\n];\n\nforeach ($values as $key =&gt; $value) {\n    echo \"$key: \";\n    var_dump($value);\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-102\">match (true)\u30d1\u30bf\u30fc\u30f3\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u4f8b\u3067\u898b\u3066\u304d\u305f\u3088\u3046\u306b\u3001<code>match (true)<\/code>\u30d1\u30bf\u30fc\u30f3\u306f\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306b\u975e\u5e38\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6761\u4ef6\u306e\u512a\u5148\u9806\u5e8f<\/strong>: \u6761\u4ef6\u306f\u30ea\u30b9\u30c8\u3055\u308c\u305f\u9806\u5e8f\u3067\u8a55\u4fa1\u3055\u308c\u3001\u6700\u521d\u306b<code>true<\/code>\u3092\u8fd4\u3059\u6761\u4ef6\u306b\u5bfe\u5fdc\u3059\u308b\u5024\u304c\u8fd4\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u6761\u4ef6\u306e\u8a73\u7d30\u5ea6<\/strong>: \u3088\u308a\u5177\u4f53\u7684\u306a\u6761\u4ef6\u3092\u5148\u306b\u8a18\u8ff0\u3057\u3001\u3088\u308a\u4e00\u822c\u7684\u306a\u6761\u4ef6\u3092\u5f8c\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u9069\u5207\u306a\u51e6\u7406\u304c\u9078\u629e\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u578b\u3068\u5024\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>: \u578b\u30c1\u30a7\u30c3\u30af\u95a2\u6570\u3068\u5024\u306e\u6761\u4ef6\u3092\u8ad6\u7406\u6f14\u7b97\u5b50\u3067\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u7d30\u304b\u306a\u6761\u4ef6\u5206\u5c90\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-103\">\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/h4>\n\n\n\n<p>match\u5f0f\u3092\u4f7f\u7528\u3057\u305f\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3082\u975e\u5e38\u306b\u30a8\u30ec\u30ac\u30f3\u30c8\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function handleException($e) {\n    $errorResponse = match (true) {\n        \/\/ \u7279\u5b9a\u306e\u4f8b\u5916\u30af\u30e9\u30b9\u306b\u3088\u308b\u51e6\u7406\n        $e instanceof InvalidArgumentException =&gt; [\n            'status' =&gt; 400,\n            'message' =&gt; $e-&gt;getMessage(),\n            'type' =&gt; 'validation_error'\n        ],\n        $e instanceof PDOException =&gt; [\n            'status' =&gt; 500,\n            'message' =&gt; '\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n            'type' =&gt; 'database_error'\n        ],\n        $e instanceof AuthenticationException =&gt; [\n            'status' =&gt; 401,\n            'message' =&gt; '\u8a8d\u8a3c\u30a8\u30e9\u30fc: ' . $e-&gt;getMessage(),\n            'type' =&gt; 'authentication_error'\n        ],\n        \n        \/\/ \u30a8\u30e9\u30fc\u30b3\u30fc\u30c9\u306b\u3088\u308b\u51e6\u7406\n        $e-&gt;getCode() === 404 =&gt; [\n            'status' =&gt; 404,\n            'message' =&gt; '\u30ea\u30bd\u30fc\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093',\n            'type' =&gt; 'not_found'\n        ],\n        \n        \/\/ \u305d\u306e\u4ed6\u306e\u4f8b\u5916\n        default =&gt; [\n            'status' =&gt; 500,\n            'message' =&gt; '\u4e88\u671f\u3057\u306a\u3044\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n            'type' =&gt; 'internal_error'\n        ],\n    };\n    \n    \/\/ \u30ed\u30b0\u8a18\u9332\n    logError($errorResponse['type'], $e-&gt;getMessage(), $e-&gt;getTraceAsString());\n    \n    \/\/ JSON\u5fdc\u7b54\u306e\u8fd4\u5374\n    header('Content-Type: application\/json');\n    http_response_code($errorResponse['status']);\n    echo json_encode($errorResponse);\n    exit;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ntry {\n    \/\/ \u4f55\u3089\u304b\u306e\u51e6\u7406\n    if (\/* \u691c\u8a3c\u30a8\u30e9\u30fc *\/) {\n        throw new InvalidArgumentException(\"\u7121\u52b9\u306a\u5165\u529b\u5024\u3067\u3059\");\n    }\n    \n    if (\/* \u8a8d\u8a3c\u30a8\u30e9\u30fc *\/) {\n        throw new AuthenticationException(\"\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u304c\u7121\u52b9\u3067\u3059\");\n    }\n    \n    if (\/* \u5b58\u5728\u3057\u306a\u3044\u30ea\u30bd\u30fc\u30b9 *\/) {\n        $e = new Exception(\"\u30ea\u30bd\u30fc\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\");\n        $e-&gt;setCode(404);\n        throw $e;\n    }\n} catch (Exception $e) {\n    handleException($e);\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-104\">\u30b3\u30fc\u30c9\u54c1\u8cea\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u30d0\u30e9\u30f3\u30b9<\/h4>\n\n\n\n<p>\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306f\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u308b\u4e00\u65b9\u3067\u3001\u591a\u6570\u306e\u6761\u4ef6\u30c1\u30a7\u30c3\u30af\u306b\u3088\u308a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u9069\u5207\u306a\u30d0\u30e9\u30f3\u30b9\u3092\u4fdd\u3064\u305f\u3081\u306e\u30d2\u30f3\u30c8\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6761\u4ef6\u306e\u6700\u9069\u5316<\/strong>: \u6700\u3082\u983b\u7e41\u306b\u4e00\u81f4\u3059\u308b\u6761\u4ef6\u3092\u5148\u306b\u914d\u7f6e\u3057\u3001\u51e6\u7406\u304c\u9ad8\u901f\u306b\u5b8c\u4e86\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u65e9\u671f\u30ea\u30bf\u30fc\u30f3<\/strong>: \u5358\u7d14\u306a\u30b1\u30fc\u30b9\u3067\u306f\u3001match\u5f0f\u306e\u524d\u306b\u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001\u6761\u4ef6\u30c1\u30a7\u30c3\u30af\u306e\u6570\u3092\u6e1b\u3089\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6d3b\u7528<\/strong>: \u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3055\u308c\u308b\u578b\u30c1\u30a7\u30c3\u30af\u306e\u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function optimizedProcessValue($value) {\n    \/\/ \u65e9\u671f\u30ea\u30bf\u30fc\u30f3\u3067\u4e00\u822c\u7684\u306a\u30b1\u30fc\u30b9\u3092\u51e6\u7406\n    if (is_null($value)) {\n        return \"NULL\u5024\u3067\u3059\";\n    }\n    \n    if (is_int($value)) {\n        return $value === 0 ? \"\u6574\u6570\u306e\u30bc\u30ed\u3067\u3059\" : ($value &gt; 0 ? \"\u6b63\u306e\u6574\u6570\u3067\u3059\" : \"\u8ca0\u306e\u6574\u6570\u3067\u3059\");\n    }\n    \n    \/\/ \u6b8b\u308a\u306e\u30b1\u30fc\u30b9\u3092match\u5f0f\u3067\u51e6\u7406\n    return match (true) {\n        is_float($value) =&gt; \"\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3067\u3059\",\n        is_string($value) &amp;&amp; $value === \"\" =&gt; \"\u7a7a\u6587\u5b57\u5217\u3067\u3059\",\n        is_string($value) =&gt; \"\u6587\u5b57\u5217\u3067\u3059\uff08\u9577\u3055: \" . strlen($value) . \"\uff09\",\n        is_array($value) =&gt; \"\u914d\u5217\u3067\u3059\uff08\u8981\u7d20\u6570: \" . count($value) . \"\uff09\",\n        is_bool($value) =&gt; $value ? \"TRUE\u5024\u3067\u3059\" : \"FALSE\u5024\u3067\u3059\",\n        default =&gt; \"\u305d\u306e\u4ed6\u306e\u578b\u3067\u3059: \" . gettype($value),\n    };\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-105\">\u307e\u3068\u3081<\/h4>\n\n\n\n<p>PHP 8\u306ematch\u5f0f\u3092\u4f7f\u3063\u305f\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u8003\u616e\u3057\u305f\u6761\u4ef6\u5206\u5c90\u306f\u3001\u5f93\u6765\u306eswitch\u6587\u3084if-else\u30c1\u30a7\u30fc\u30f3\u306b\u6bd4\u3079\u3066\u3001\u3088\u308a\u7c21\u6f54\u3067\u30a8\u30ec\u30ac\u30f3\u30c8\u306a\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3057\u307e\u3059\u3002\u7279\u306b\u3001<code>match (true)<\/code>\u30d1\u30bf\u30fc\u30f3\u306f\u8907\u96d1\u306a\u6761\u4ef6\u3092\u8868\u73fe\u3059\u308b\u5f37\u529b\u306a\u624b\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u306f\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406\u3001\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u306e\u691c\u8a3c\u3001\u52d5\u7684\u306a\u578b\u5909\u63db\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306a\u3069\u3001\u69d8\u3005\u306a\u30b7\u30ca\u30ea\u30aa\u3067\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002\u6761\u4ef6\u306e\u9806\u5e8f\u3068\u8a73\u7d30\u5ea6\u306b\u6ce8\u610f\u3057\u306a\u304c\u3089\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u8003\u616e\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-106\">\u5b9f\u8df5\u7684\u306a\u578b\u78ba\u8a8d\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u3068\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>\u3053\u308c\u307e\u3067\u3001PHP\u306b\u304a\u3051\u308b\u69d8\u3005\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3053\u308c\u3089\u306e\u6280\u8853\u3092\u3069\u306e\u3088\u3046\u306b\u6d3b\u7528\u3059\u308c\u3070\u3088\u3044\u306e\u3067\u3057\u3087\u3046\u304b\u3002\u3053\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5b9f\u969b\u306e\u958b\u767a\u73fe\u5834\u3067\u906d\u9047\u3059\u308b\u4ee3\u8868\u7684\u306a\u30b7\u30ca\u30ea\u30aa\u3068\u3001\u305d\u308c\u306b\u5bfe\u5fdc\u3059\u308b\u578b\u78ba\u8a8d\u306e\u5b9f\u8df5\u7684\u306a\u5b9f\u88c5\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u5358\u306a\u308b\u6280\u8853\u7684\u306a\u30a8\u30af\u30b5\u30b5\u30a4\u30ba\u3067\u306f\u306a\u304f\u3001\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u8981\u7d20\u3067\u3059\u3002\u9069\u5207\u306a\u578b\u78ba\u8a8d\u306b\u3088\u308a\u3001\u30c7\u30fc\u30bf\u306e\u6574\u5408\u6027\u3092\u4fdd\u3061\u3001\u30d0\u30b0\u3092\u672a\u7136\u306b\u9632\u304e\u3001\u3088\u308a\u4e88\u6e2c\u53ef\u80fd\u306a\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-107\">\u5b9f\u8df5\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/h3>\n\n\n\n<p>\u5b9f\u969b\u306e\u958b\u767a\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30ca\u30ea\u30aa\u3067\u578b\u78ba\u8a8d\u304c\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e6\u30fc\u30b6\u30fc\u5165\u529b\uff08\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\uff09\u306e\u691c\u8a3c<\/li>\n\n\n\n<li>API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u51e6\u7406<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u306e\u53d6\u5f97\u7d50\u679c\u306e\u51e6\u7406<\/li>\n\n\n\n<li>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3084\u5916\u90e8\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f<\/li>\n\n\n\n<li>\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306e\u691c\u8a3c<\/li>\n\n\n\n<li>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u9593\u306e\u76f8\u4e92\u4f5c\u7528\u306b\u304a\u3051\u308b\u578b\u306e\u78ba\u8a8d<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30b7\u30ca\u30ea\u30aa\u306b\u3064\u3044\u3066\u3001\u5b9f\u8df5\u7684\u306a\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u3068\u3082\u306b\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-108\">\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u306e\u5165\u529b\u5024\u3092\u9069\u5207\u306b\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u306e\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u3092\u9069\u5207\u306b\u691c\u8a3c\u3059\u308b\u3053\u3068\u306f\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u6a5f\u80fd\u306e\u4fe1\u983c\u6027\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306b\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002PHP\u3067\u306f\u3001\u578b\u78ba\u8a8d\u6a5f\u80fd\u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u3092\u52b9\u679c\u7684\u306b\u691c\u8a3c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-109\">\u57fa\u672c\u7684\u306a\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u306e\u6d41\u308c<\/h4>\n\n\n\n<p>\u4e00\u822c\u7684\u306a\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u306e\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5165\u529b\u5024\u306e\u5b58\u5728\u30c1\u30a7\u30c3\u30af\uff08\u5fc5\u9808\u9805\u76ee\uff09<\/li>\n\n\n\n<li>\u5165\u529b\u5024\u306e\u578b\u30c1\u30a7\u30c3\u30af\uff08\u6570\u5024\u3001\u6587\u5b57\u5217\u306a\u3069\uff09<\/li>\n\n\n\n<li>\u5165\u529b\u5024\u306e\u7bc4\u56f2\u3084\u5f62\u5f0f\u306e\u30c1\u30a7\u30c3\u30af\uff08\u6700\u5c0f\/\u6700\u5927\u5024\u3001\u6b63\u898f\u8868\u73fe\u306a\u3069\uff09<\/li>\n\n\n\n<li>\u5165\u529b\u5024\u306e\u6574\u5f62\uff08\u30c8\u30ea\u30e0\u3001HTML\u30a8\u30b9\u30b1\u30fc\u30d7\u306a\u3069\uff09<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u578b\u3078\u306e\u5909\u63db\uff08\u6587\u5b57\u5217\u304b\u3089\u6570\u5024\u3078\u306a\u3069\uff09<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u306e\u691c\u8a3c\u3092\u4f8b\u306b\u3068\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u30d5\u30a9\u30fc\u30e0\u5165\u529b\u3092\u691c\u8a3c\u3057\u3001\u9069\u5207\u306a\u578b\u306b\u5909\u63db\u3059\u308b\u95a2\u6570\n * \n * @param array $input $_POST \u3084 $_GET \u306a\u3069\u306e\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u914d\u5217\n * @return array \u691c\u8a3c\u30fb\u5909\u63db\u6e08\u307f\u306e\u30c7\u30fc\u30bf\u914d\u5217\n * @throws InvalidArgumentException \u691c\u8a3c\u30a8\u30e9\u30fc\u6642\n *\/\nfunction validateRegistrationForm(array $input): array {\n    $validated = [];\n    $errors = [];\n    \n    \/\/ 1. \u30e6\u30fc\u30b6\u30fc\u540d\uff08\u5fc5\u9808\u3001\u6587\u5b57\u5217\u30013\uff5e50\u6587\u5b57\uff09\n    if (!isset($input['username']) || !is_string($input['username'])) {\n        $errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059';\n    } elseif (strlen(trim($input['username'])) &lt; 3) {\n        $errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f3\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n    } elseif (strlen($input['username']) &gt; 50) {\n        $errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f50\u6587\u5b57\u4ee5\u4e0b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n    } else {\n        $validated['username'] = trim($input['username']);\n    }\n    \n    \/\/ 2. \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff08\u5fc5\u9808\u3001\u6709\u52b9\u306a\u5f62\u5f0f\uff09\n    if (!isset($input['email']) || !is_string($input['email'])) {\n        $errors['email'] = '\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059';\n    } elseif (!filter_var(trim($input['email']), FILTER_VALIDATE_EMAIL)) {\n        $errors['email'] = '\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044';\n    } else {\n        $validated['email'] = strtolower(trim($input['email']));\n    }\n    \n    \/\/ 3. \u5e74\u9f62\uff08\u5fc5\u9808\u3001\u6574\u6570\u300118\uff5e120\u6b73\uff09\n    if (!isset($input['age']) || $input['age'] === '') {\n        $errors['age'] = '\u5e74\u9f62\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059';\n    } elseif (!is_numeric($input['age'])) {\n        $errors['age'] = '\u5e74\u9f62\u306f\u6570\u5024\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044';\n    } elseif ((int)$input['age'] &lt; 18) {\n        $errors['age'] = '\u5e74\u9f62\u306f18\u6b73\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n    } elseif ((int)$input['age'] &gt; 120) {\n        $errors['age'] = '\u6b63\u3057\u3044\u5e74\u9f62\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044';\n    } else {\n        \/\/ \u6587\u5b57\u5217\u304b\u3089\u6574\u6570\u3078\u306e\u660e\u793a\u7684\u306a\u5909\u63db\n        $validated['age'] = (int)$input['age'];\n    }\n    \n    \/\/ 4. \u30d1\u30b9\u30ef\u30fc\u30c9\uff08\u5fc5\u9808\u30018\u6587\u5b57\u4ee5\u4e0a\uff09\n    if (!isset($input['password']) || !is_string($input['password'])) {\n        $errors['password'] = '\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059';\n    } elseif (strlen($input['password']) &lt; 8) {\n        $errors['password'] = '\u30d1\u30b9\u30ef\u30fc\u30c9\u306f8\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n    } else {\n        \/\/ \u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u5316\u3059\u308b\n        $validated['password'] = $input['password'];\n    }\n    \n    \/\/ 5. \u5229\u7528\u898f\u7d04\u540c\u610f\uff08\u5fc5\u9808\u3001\u771f\u507d\u5024\uff09\n    $termsAccepted = isset($input['terms']) &amp;&amp; ($input['terms'] === '1' || $input['terms'] === 'on' || $input['terms'] === true);\n    if (!$termsAccepted) {\n        $errors['terms'] = '\u5229\u7528\u898f\u7d04\u306b\u540c\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n    } else {\n        $validated['terms_accepted'] = true;\n    }\n    \n    \/\/ 6. \u8208\u5473\u306e\u3042\u308b\u5206\u91ce\uff08\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u914d\u5217\uff09\n    if (isset($input['interests'])) {\n        if (!is_array($input['interests'])) {\n            $errors['interests'] = '\u8208\u5473\u306e\u3042\u308b\u5206\u91ce\u306e\u5f62\u5f0f\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093';\n        } else {\n            $allowedInterests = ['technology', 'science', 'art', 'sports', 'music'];\n            $validated['interests'] = array_intersect($input['interests'], $allowedInterests);\n        }\n    } else {\n        $validated['interests'] = [];\n    }\n    \n    \/\/ \u30a8\u30e9\u30fc\u304c\u3042\u308b\u5834\u5408\u306f\u4f8b\u5916\u3092\u30b9\u30ed\u30fc\n    if (!empty($errors)) {\n        throw new InvalidArgumentException(json_encode($errors));\n    }\n    \n    return $validated;\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ntry {\n    \/\/ $_POST\u306e\u4ee3\u308f\u308a\u306b\u30c6\u30b9\u30c8\u7528\u306e\u914d\u5217\u3092\u4f7f\u7528\n    $input = [\n        'username' =&gt; ' JohnDoe ',  \/\/ \u524d\u5f8c\u306b\u7a7a\u767d\u304c\u3042\u308b\n        'email' =&gt; 'john.doe@example.com',\n        'age' =&gt; '25',  \/\/ \u6587\u5b57\u5217\u3068\u3057\u3066\u9001\u4fe1\u3055\u308c\u308b\n        'password' =&gt; 'SecurePass123',\n        'terms' =&gt; 'on',\n        'interests' =&gt; ['technology', 'music', 'invalid_interest']  \/\/ \u7121\u52b9\u306a\u5024\u3092\u542b\u3080\n    ];\n    \n    $validatedData = validateRegistrationForm($input);\n    \n    \/\/ \u691c\u8a3c\u30fb\u5909\u63db\u6e08\u307f\u30c7\u30fc\u30bf\u306e\u78ba\u8a8d\n    echo \"\u691c\u8a3c\u7d50\u679c\uff1a\\n\";\n    var_dump($validatedData);\n    \n    \/\/ \u578b\u306e\u78ba\u8a8d\n    echo \"\\n\u578b\u306e\u78ba\u8a8d\uff1a\\n\";\n    echo \"username: \" . gettype($validatedData['username']) . \"\\n\";\n    echo \"email: \" . gettype($validatedData['email']) . \"\\n\";\n    echo \"age: \" . gettype($validatedData['age']) . \"\\n\";\n    echo \"interests: \" . gettype($validatedData['interests']) . \"\\n\";\n    \n} catch (InvalidArgumentException $e) {\n    echo \"\u691c\u8a3c\u30a8\u30e9\u30fc\uff1a\\n\";\n    $errors = json_decode($e-&gt;getMessage(), true);\n    foreach ($errors as $field =&gt; $message) {\n        echo \"$field: $message\\n\";\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-110\">PHP 8\u3092\u4f7f\u7528\u3057\u305f\u6539\u826f\u30d0\u30fc\u30b8\u30e7\u30f3<\/h4>\n\n\n\n<p>PHP 8\u306ematch\u5f0f\u3068\u5171\u7528\u578b\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u7c21\u6f54\u3067\u8aad\u307f\u3084\u3059\u3044\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * PHP 8\u306ematch\u5f0f\u3068\u5171\u7528\u578b\u3092\u4f7f\u7528\u3057\u305f\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\n *\/\nfunction validateRegistrationFormPHP8(array $input): array {\n    $validated = [];\n    $errors = [];\n    \n    \/\/ \u30e6\u30fc\u30b6\u30fc\u540d\u306e\u691c\u8a3c\n    $username = $input['username'] ?? null;\n    $validated['username'] = match (true) {\n        !is_string($username) =&gt; \n            throw new InvalidArgumentException('\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        strlen(trim($username)) &lt; 3 =&gt; \n            throw new InvalidArgumentException('\u30e6\u30fc\u30b6\u30fc\u540d\u306f3\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        strlen($username) &gt; 50 =&gt; \n            throw new InvalidArgumentException('\u30e6\u30fc\u30b6\u30fc\u540d\u306f50\u6587\u5b57\u4ee5\u4e0b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        default =&gt; trim($username)\n    };\n    \n    \/\/ \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\n    $email = $input['email'] ?? null;\n    $validated['email'] = match (true) {\n        !is_string($email) =&gt; \n            throw new InvalidArgumentException('\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        !filter_var(trim($email), FILTER_VALIDATE_EMAIL) =&gt; \n            throw new InvalidArgumentException('\u6709\u52b9\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n        default =&gt; strtolower(trim($email))\n    };\n    \n    \/\/ \u5e74\u9f62\u306e\u691c\u8a3c\n    $age = $input['age'] ?? null;\n    $validated['age'] = match (true) {\n        $age === null || $age === '' =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059'),\n        !is_numeric($age) =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u306f\u6570\u5024\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        (int)$age &lt; 18 =&gt; \n            throw new InvalidArgumentException('\u5e74\u9f62\u306f18\u6b73\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        (int)$age &gt; 120 =&gt; \n            throw new InvalidArgumentException('\u6b63\u3057\u3044\u5e74\u9f62\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044'),\n        default =&gt; (int)$age\n    };\n    \n    \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u691c\u8a3c\n    $password = $input['password'] ?? null;\n    $validated['password'] = match (true) {\n        !is_string($password) =&gt; \n            throw new InvalidArgumentException('\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        strlen($password) &lt; 8 =&gt; \n            throw new InvalidArgumentException('\u30d1\u30b9\u30ef\u30fc\u30c9\u306f8\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059'),\n        default =&gt; $password\n    };\n    \n    \/\/ \u5229\u7528\u898f\u7d04\u540c\u610f\u306e\u691c\u8a3c\n    $terms = $input['terms'] ?? null;\n    $validated['terms_accepted'] = match (true) {\n        $terms === '1' || $terms === 'on' || $terms === true =&gt; true,\n        default =&gt; throw new InvalidArgumentException('\u5229\u7528\u898f\u7d04\u306b\u540c\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059')\n    };\n    \n    \/\/ \u8208\u5473\u306e\u3042\u308b\u5206\u91ce\u306e\u691c\u8a3c\n    $interests = $input['interests'] ?? [];\n    $validated['interests'] = match (true) {\n        !is_array($interests) =&gt; \n            throw new InvalidArgumentException('\u8208\u5473\u306e\u3042\u308b\u5206\u91ce\u306f\u914d\u5217\u5f62\u5f0f\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044'),\n        default =&gt; array_intersect($interests, ['technology', 'science', 'art', 'sports', 'music'])\n    };\n    \n    return $validated;\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-111\">\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u305f\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c<\/h4>\n\n\n\n<p>\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u3092\u30ab\u30d7\u30bb\u30eb\u5316\u3059\u308b\u3068\u3001\u30b3\u30fc\u30c9\u306e\u7ba1\u7406\u304c\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u767b\u9332\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u30af\u30e9\u30b9\n *\/\nclass RegistrationRequest {\n    private array $data;\n    private array $validated = [];\n    private array $errors = [];\n    \n    public function __construct(array $data) {\n        $this-&gt;data = $data;\n    }\n    \n    \/**\n     * \u30ea\u30af\u30a8\u30b9\u30c8\u3092\u691c\u8a3c\u3059\u308b\n     *\/\n    public function validate(): bool {\n        try {\n            $this-&gt;validateUsername();\n            $this-&gt;validateEmail();\n            $this-&gt;validateAge();\n            $this-&gt;validatePassword();\n            $this-&gt;validateTerms();\n            $this-&gt;validateInterests();\n            \n            return empty($this-&gt;errors);\n        } catch (Exception $e) {\n            $this-&gt;errors['general'] = $e-&gt;getMessage();\n            return false;\n        }\n    }\n    \n    \/**\n     * \u30e6\u30fc\u30b6\u30fc\u540d\u3092\u691c\u8a3c\u3059\u308b\n     *\/\n    private function validateUsername(): void {\n        $username = $this-&gt;data['username'] ?? null;\n        \n        if (!isset($username) || !is_string($username)) {\n            $this-&gt;errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f\u5fc5\u9808\u9805\u76ee\u3067\u3059';\n            return;\n        }\n        \n        $username = trim($username);\n        \n        if (strlen($username) &lt; 3) {\n            $this-&gt;errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f3\u6587\u5b57\u4ee5\u4e0a\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n            return;\n        }\n        \n        if (strlen($username) &gt; 50) {\n            $this-&gt;errors['username'] = '\u30e6\u30fc\u30b6\u30fc\u540d\u306f50\u6587\u5b57\u4ee5\u4e0b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059';\n            return;\n        }\n        \n        $this-&gt;validated['username'] = $username;\n    }\n    \n    \/\/ \u4ed6\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u691c\u8a3c\u30e1\u30bd\u30c3\u30c9\uff08\u7565\uff09...\n    \n    \/**\n     * \u691c\u8a3c\u6e08\u307f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\n     *\/\n    public function validated(): array {\n        if (!empty($this-&gt;errors)) {\n            throw new RuntimeException('\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093');\n        }\n        \n        return $this-&gt;validated;\n    }\n    \n    \/**\n     * \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\n     *\/\n    public function errors(): array {\n        return $this-&gt;errors;\n    }\n    \n    \/**\n     * \u6307\u5b9a\u3057\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d6\u5f97\u3059\u308b\n     *\/\n    public function getError(string $field): ?string {\n        return $this-&gt;errors[$field] ?? null;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$request = new RegistrationRequest($_POST);\n\nif ($request-&gt;validate()) {\n    $userData = $request-&gt;validated();\n    \/\/ \u30e6\u30fc\u30b6\u30fc\u767b\u9332\u51e6\u7406...\n} else {\n    \/\/ \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8868\u793a\n    $errors = $request-&gt;errors();\n    foreach ($errors as $field =&gt; $message) {\n        echo \"$field: $message&lt;br&gt;\";\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-112\">\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5e38\u306b\u578b\u3092\u8003\u616e\u3059\u308b<\/strong>: \u30d5\u30a9\u30fc\u30e0\u304b\u3089\u9001\u4fe1\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306f\u5e38\u306b\u6587\u5b57\u5217\u307e\u305f\u306f\u914d\u5217\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\u3002\u9069\u5207\u306a\u578b\u3078\u306e\u5909\u63db\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>XSS\u5bfe\u7b56\u3092\u884c\u3046<\/strong>: \u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3092\u8868\u793a\u3059\u308b\u524d\u306b\u3001\u5e38\u306b<code>htmlspecialchars()<\/code>\u306a\u3069\u3092\u4f7f\u7528\u3057\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5b89\u5168\u306a\u51fa\u529b\necho htmlspecialchars($validated['username'], ENT_QUOTES, 'UTF-8');\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u5bfe\u7b56<\/strong>: \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u524d\u306b\u3001\u30d7\u30ea\u30da\u30a2\u30c9\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$stmt = $pdo-&gt;prepare(\"INSERT INTO users (username, email, age) VALUES (?, ?, ?)\");\n$stmt-&gt;execute([$validated['username'], $validated['email'], $validated['age']]);\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u5165\u529b\u5024\u306e\u6574\u5f62\u3092\u9069\u5207\u306b\u884c\u3046<\/strong>: \u5165\u529b\u5024\u306e\u30c8\u30ea\u30e0\u3084\u6b63\u898f\u5316\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$email = strtolower(trim($input['email']));\n$phone = preg_replace('\/[^0-9]\/', '', $input['phone']); \/\/ \u6570\u5b57\u4ee5\u5916\u3092\u524a\u9664\n<\/pre>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li><strong>\u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u4e00\u5143\u7ba1\u7406\u3059\u308b<\/strong>: \u691c\u8a3c\u30eb\u30fc\u30eb\u3092\u30af\u30e9\u30b9\u3084\u30d5\u30a1\u30a4\u30eb\u3068\u3057\u3066\u4e00\u5143\u7ba1\u7406\u3059\u308b\u3068\u3001\u4e00\u8cab\u6027\u306e\u3042\u308b\u691c\u8a3c\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<p>PHP\u306e\u578b\u78ba\u8a8d\u6a5f\u80fd\u3092\u6d3b\u7528\u3057\u305f\u30d5\u30a9\u30fc\u30e0\u691c\u8a3c\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u306b\u8d77\u56e0\u3059\u308b\u30d0\u30b0\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u554f\u984c\u3092\u5927\u5e45\u306b\u6e1b\u3089\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u3001\u30ed\u30b0\u30a4\u30f3\u3001\u5546\u54c1\u6ce8\u6587\u306a\u3069\u3001\u91cd\u8981\u306a\u30c7\u30fc\u30bf\u3092\u6271\u3046\u30d5\u30a9\u30fc\u30e0\u3067\u306f\u3001\u5165\u5ff5\u306a\u578b\u78ba\u8a8d\u3068\u691c\u8a3c\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-113\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306b\u3088\u308b\u5805\u7262\u306a\u30c7\u30fc\u30bf\u51e6\u7406\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u73fe\u4ee3\u306e\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u5916\u90e8API\u3068\u306e\u9023\u643a\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002\u3057\u304b\u3057\u3001API\u304b\u3089\u8fd4\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306e\u5f62\u5f0f\u3084\u578b\u306f\u5fc5\u305a\u3057\u3082\u4e00\u8cab\u3057\u3066\u3044\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u30c7\u30fc\u30bf\u306e\u6b20\u843d\u3001\u578b\u306e\u4e0d\u4e00\u81f4\u3001\u4e88\u671f\u3057\u306a\u3044\u69cb\u9020\u306a\u3069\u3001\u69d8\u3005\u306a\u554f\u984c\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3046\u3057\u305f\u554f\u984c\u306b\u5bfe\u51e6\u3059\u308b\u305f\u3081\u306b\u306f\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u5bfe\u3059\u308b\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3068\u9069\u5207\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-114\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u57fa\u672c\u7684\u306a\u691c\u8a3c<\/h4>\n\n\n\n<p>\u5916\u90e8API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\u3059\u308b\u969b\u306e\u57fa\u672c\u7684\u306a\u6d41\u308c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u53d7\u4fe1\u3068\u30c7\u30b3\u30fc\u30c9\uff08\u901a\u5e38\u306fJSON\u304b\u3089PHP\u306e\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\uff09<\/li>\n\n\n\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u69cb\u9020\u3068\u5b58\u5728\u6027\u306e\u30c1\u30a7\u30c3\u30af<\/li>\n\n\n\n<li>\u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u578b\u30c1\u30a7\u30c3\u30af<\/li>\n\n\n\n<li>\u5fc5\u8981\u306b\u5fdc\u3058\u305f\u30c7\u30fc\u30bf\u306e\u5909\u63db\u3068\u6574\u5f62<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30b1\u30fc\u30b9\u306e\u9069\u5207\u306a\u51e6\u7406<\/li>\n<\/ol>\n\n\n\n<p>\u4ee5\u4e0b\u306b\u3001\u5916\u90e8API\u304b\u3089\u306e\u5929\u6c17\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u51e6\u7406\u3059\u308b\u4f8b\u3092\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u5929\u6c17API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u691c\u8a3c\u3057\u51e6\u7406\u3059\u308b\u95a2\u6570\n * \n * @param string $cityName \u90fd\u5e02\u540d\n * @return array \u691c\u8a3c\u6e08\u307f\u306e\u5929\u6c17\u30c7\u30fc\u30bf\n * @throws Exception API\u547c\u3073\u51fa\u3057\u3084\u30c7\u30fc\u30bf\u691c\u8a3c\u306e\u5931\u6557\u6642\n *\/\nfunction getWeatherData(string $cityName): array {\n    \/\/ 1. API\u3078\u306e\u30ea\u30af\u30a8\u30b9\u30c8\uff08\u4eee\u60f3\u7684\u306a\u30b3\u30fc\u30c9\uff09\n    $apiKey = 'your_api_key';\n    $url = \"https:\/\/api.weather.example.com\/current?city=\" . urlencode($cityName) . \"&amp;key={$apiKey}\";\n    \n    $response = file_get_contents($url);\n    if ($response === false) {\n        throw new Exception(\"API\u3078\u306e\u63a5\u7d9a\u306b\u5931\u6557\u3057\u307e\u3057\u305f\");\n    }\n    \n    \/\/ 2. JSON\u30c7\u30b3\u30fc\u30c9\n    $data = json_decode($response, true);\n    if (json_last_error() !== JSON_ERROR_NONE) {\n        throw new Exception(\"JSON\u30c7\u30b3\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f: \" . json_last_error_msg());\n    }\n    \n    \/\/ 3. \u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u57fa\u672c\u69cb\u9020\u30c1\u30a7\u30c3\u30af\n    if (!is_array($data)) {\n        throw new Exception(\"API\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    \/\/ 4. \u30a8\u30e9\u30fc\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u30c1\u30a7\u30c3\u30af\n    if (isset($data['error'])) {\n        $errorMessage = is_string($data['error']) ? $data['error'] : 'API\u304b\u3089\u30a8\u30e9\u30fc\u304c\u8fd4\u3055\u308c\u307e\u3057\u305f';\n        throw new Exception($errorMessage);\n    }\n    \n    \/\/ 5. \u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5b58\u5728\u30c1\u30a7\u30c3\u30af\u3068\u578b\u30c1\u30a7\u30c3\u30af\n    $required = ['location', 'current', 'updated_at'];\n    foreach ($required as $field) {\n        if (!isset($data[$field])) {\n            throw new Exception(\"\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9 '{$field}' \u304cAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\");\n        }\n    }\n    \n    \/\/ \u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u306e\u691c\u8a3c\n    if (!is_array($data['location'])) {\n        throw new Exception(\"location \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    if (!isset($data['location']['name']) || !is_string($data['location']['name'])) {\n        throw new Exception(\"location.name \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    if (!isset($data['location']['country']) || !is_string($data['location']['country'])) {\n        throw new Exception(\"location.country \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    \/\/ \u73fe\u5728\u306e\u5929\u6c17\u60c5\u5831\u306e\u691c\u8a3c\n    if (!is_array($data['current'])) {\n        throw new Exception(\"current \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    if (!isset($data['current']['temp_c']) || !is_numeric($data['current']['temp_c'])) {\n        throw new Exception(\"current.temp_c \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    if (!isset($data['current']['condition']) || !is_array($data['current']['condition'])) {\n        throw new Exception(\"current.condition \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    if (!isset($data['current']['condition']['text']) || !is_string($data['current']['condition']['text'])) {\n        throw new Exception(\"current.condition.text \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    \/\/ \u66f4\u65b0\u65e5\u6642\u306e\u691c\u8a3c\n    if (!is_string($data['updated_at']) &amp;&amp; !is_numeric($data['updated_at'])) {\n        throw new Exception(\"updated_at \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u307e\u305f\u306f\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\");\n    }\n    \n    \/\/ 6. \u691c\u8a3c\u6e08\u307f\u306e\u30c7\u30fc\u30bf\u3092\u6574\u5f62\u3057\u3066\u8fd4\u3059\n    return [\n        'city' =&gt; $data['location']['name'],\n        'country' =&gt; $data['location']['country'],\n        'temperature' =&gt; (float) $data['current']['temp_c'],\n        'condition' =&gt; $data['current']['condition']['text'],\n        'updated_at' =&gt; is_numeric($data['updated_at']) \n            ? date('Y-m-d H:i:s', (int) $data['updated_at']) \n            : $data['updated_at']\n    ];\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ntry {\n    $weatherData = getWeatherData('Tokyo');\n    \n    echo \"\u73fe\u5728\u306e {$weatherData['city']} ({$weatherData['country']}) \u306e\u5929\u6c17\uff1a\\n\";\n    echo \"\u6c17\u6e29: {$weatherData['temperature']}\u2103\\n\";\n    echo \"\u72b6\u614b: {$weatherData['condition']}\\n\";\n    echo \"\u66f4\u65b0: {$weatherData['updated_at']}\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage() . \"\\n\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-115\">PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3092\u4f7f\u7528\u3057\u305fAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u691c\u8a3c<\/h4>\n\n\n\n<p>PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u691c\u8a3c\u3092\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u8aad\u307f\u3084\u3059\u304f\u5b9f\u88c5\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3092\u4f7f\u7528\u3057\u3066API\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u691c\u8a3c\u3059\u308b\u95a2\u6570\n *\/\nfunction validateWeatherResponse(array $data): array {\n    \/\/ \u57fa\u672c\u7684\u306a\u69cb\u9020\u30c1\u30a7\u30c3\u30af\n    $errorCheck = match (true) {\n        isset($data['error']) &amp;&amp; is_string($data['error']) =&gt; throw new Exception($data['error']),\n        isset($data['error']) =&gt; throw new Exception(\"API\u304b\u3089\u30a8\u30e9\u30fc\u304c\u8fd4\u3055\u308c\u307e\u3057\u305f\"),\n        !isset($data['location']) =&gt; throw new Exception(\"\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9 'location' \u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['current']) =&gt; throw new Exception(\"\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9 'current' \u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['updated_at']) =&gt; throw new Exception(\"\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9 'updated_at' \u304c\u3042\u308a\u307e\u305b\u3093\"),\n        default =&gt; true\n    };\n    \n    \/\/ location\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u691c\u8a3c\n    $location = match (true) {\n        !is_array($data['location']) =&gt; throw new Exception(\"location \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['location']['name']) =&gt; throw new Exception(\"location.name \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !is_string($data['location']['name']) =&gt; throw new Exception(\"location.name \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['location']['country']) =&gt; throw new Exception(\"location.country \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !is_string($data['location']['country']) =&gt; throw new Exception(\"location.country \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        default =&gt; [\n            'city' =&gt; $data['location']['name'],\n            'country' =&gt; $data['location']['country']\n        ]\n    };\n    \n    \/\/ current\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u691c\u8a3c\n    $current = match (true) {\n        !is_array($data['current']) =&gt; throw new Exception(\"current \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['current']['temp_c']) =&gt; throw new Exception(\"current.temp_c \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !is_numeric($data['current']['temp_c']) =&gt; throw new Exception(\"current.temp_c \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['current']['condition']) =&gt; throw new Exception(\"current.condition \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !is_array($data['current']['condition']) =&gt; throw new Exception(\"current.condition \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        !isset($data['current']['condition']['text']) =&gt; throw new Exception(\"current.condition.text \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308a\u307e\u305b\u3093\"),\n        !is_string($data['current']['condition']['text']) =&gt; throw new Exception(\"current.condition.text \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\"),\n        default =&gt; [\n            'temperature' =&gt; (float) $data['current']['temp_c'],\n            'condition' =&gt; $data['current']['condition']['text']\n        ]\n    };\n    \n    \/\/ updated_at\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u691c\u8a3c\n    $updatedAt = match (true) {\n        is_string($data['updated_at']) =&gt; $data['updated_at'],\n        is_numeric($data['updated_at']) =&gt; date('Y-m-d H:i:s', (int) $data['updated_at']),\n        default =&gt; throw new Exception(\"updated_at \u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6587\u5b57\u5217\u307e\u305f\u306f\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093\")\n    };\n    \n    \/\/ \u691c\u8a3c\u6e08\u307f\u30c7\u30fc\u30bf\u306e\u7d50\u5408\n    return [\n        ...$location,\n        ...$current,\n        'updated_at' =&gt; $updatedAt\n    ];\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-116\">\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u3092\u4f7f\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u30a2\u30d7\u30ed\u30fc\u30c1<\/h4>\n\n\n\n<p>\u5927\u898f\u6a21\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u5c02\u7528\u306e\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u5ba3\u8a00\u7684\u304b\u3064\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u578b\u30c1\u30a7\u30c3\u30af\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u81ea\u4f5c\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u30af\u30e9\u30b9\u306e\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u3092\u884c\u3046\u30af\u30e9\u30b9\n *\/\nclass SchemaValidator {\n    \/**\n     * \u5024\u304c\u30b9\u30ad\u30fc\u30de\u306b\u5f93\u3063\u3066\u3044\u308b\u304b\u691c\u8a3c\u3059\u308b\n     *\n     * @param mixed $value \u691c\u8a3c\u3059\u308b\u5024\n     * @param array $schema \u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\n     * @param string $path \u30a8\u30e9\u30fc\u5831\u544a\u7528\u306e\u30d1\u30b9\n     * @return mixed \u691c\u8a3c\u6e08\u307f\u306e\u5024\n     * @throws InvalidArgumentException \u691c\u8a3c\u5931\u6557\u6642\n     *\/\n    public function validate($value, array $schema, string $path = 'root'): mixed {\n        \/\/ \u578b\u30c1\u30a7\u30c3\u30af\n        if (isset($schema['type'])) {\n            $this-&gt;validateType($value, $schema['type'], $path);\n        }\n        \n        \/\/ \u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9\u30c1\u30a7\u30c3\u30af\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\/\u914d\u5217\uff09\n        if (isset($schema['required']) &amp;&amp; is_array($schema['required']) &amp;&amp; is_array($value)) {\n            foreach ($schema['required'] as $requiredField) {\n                if (!isset($value[$requiredField])) {\n                    throw new InvalidArgumentException(\"'{$path}' \u306e\u5fc5\u9808\u30d5\u30a3\u30fc\u30eb\u30c9 '{$requiredField}' \u304c\u3042\u308a\u307e\u305b\u3093\");\n                }\n            }\n        }\n        \n        \/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u691c\u8a3c\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\/\u914d\u5217\uff09\n        if (isset($schema['properties']) &amp;&amp; is_array($schema['properties']) &amp;&amp; is_array($value)) {\n            $result = [];\n            \n            foreach ($schema['properties'] as $propName =&gt; $propSchema) {\n                if (isset($value[$propName])) {\n                    $result[$propName] = $this-&gt;validate($value[$propName], $propSchema, \"{$path}.{$propName}\");\n                } elseif (isset($propSchema['default'])) {\n                    $result[$propName] = $propSchema['default'];\n                }\n            }\n            \n            return $result;\n        }\n        \n        \/\/ \u914d\u5217\u30a2\u30a4\u30c6\u30e0\u306e\u691c\u8a3c\n        if (isset($schema['items']) &amp;&amp; is_array($schema['items']) &amp;&amp; is_array($value) &amp;&amp; !isset($value[0])) {\n            $result = [];\n            \n            foreach ($value as $index =&gt; $item) {\n                $result[$index] = $this-&gt;validate($item, $schema['items'], \"{$path}[{$index}]\");\n            }\n            \n            return $result;\n        }\n        \n        \/\/ \u5024\u306e\u5909\u63db\n        if (isset($schema['convert'])) {\n            $value = $this-&gt;convert($value, $schema['convert']);\n        }\n        \n        return $value;\n    }\n    \n    \/**\n     * \u5024\u306e\u578b\u3092\u691c\u8a3c\u3059\u308b\n     *\/\n    private function validateType($value, string $type, string $path): void {\n        $valid = match ($type) {\n            'string' =&gt; is_string($value),\n            'number' =&gt; is_numeric($value),\n            'integer' =&gt; is_int($value) || (is_string($value) &amp;&amp; ctype_digit($value)),\n            'boolean' =&gt; is_bool($value),\n            'array' =&gt; is_array($value),\n            'object' =&gt; is_array($value) || is_object($value),\n            'null' =&gt; is_null($value),\n            default =&gt; throw new InvalidArgumentException(\"\u4e0d\u660e\u306a\u578b '{$type}' \u304c\u6307\u5b9a\u3055\u308c\u307e\u3057\u305f\")\n        };\n        \n        if (!$valid) {\n            throw new InvalidArgumentException(\"'{$path}' \u306f\u578b '{$type}' \u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001\" . gettype($value) . \" \u304c\u4e0e\u3048\u3089\u308c\u307e\u3057\u305f\");\n        }\n    }\n    \n    \/**\n     * \u5024\u3092\u6307\u5b9a\u3055\u308c\u305f\u578b\u306b\u5909\u63db\u3059\u308b\n     *\/\n    private function convert($value, string $type): mixed {\n        return match ($type) {\n            'string' =&gt; (string) $value,\n            'number' =&gt; (float) $value,\n            'integer' =&gt; (int) $value,\n            'boolean' =&gt; (bool) $value,\n            default =&gt; $value\n        };\n    }\n}\n\n\/\/ \u5929\u6c17API\u306e\u30b9\u30ad\u30fc\u30de\u5b9a\u7fa9\n$weatherSchema = [\n    'type' =&gt; 'object',\n    'required' =&gt; ['location', 'current', 'updated_at'],\n    'properties' =&gt; [\n        'location' =&gt; [\n            'type' =&gt; 'object',\n            'required' =&gt; ['name', 'country'],\n            'properties' =&gt; [\n                'name' =&gt; ['type' =&gt; 'string'],\n                'country' =&gt; ['type' =&gt; 'string']\n            ]\n        ],\n        'current' =&gt; [\n            'type' =&gt; 'object',\n            'required' =&gt; ['temp_c', 'condition'],\n            'properties' =&gt; [\n                'temp_c' =&gt; ['type' =&gt; 'number', 'convert' =&gt; 'number'],\n                'condition' =&gt; [\n                    'type' =&gt; 'object',\n                    'required' =&gt; ['text'],\n                    'properties' =&gt; [\n                        'text' =&gt; ['type' =&gt; 'string']\n                    ]\n                ]\n            ]\n        ],\n        'updated_at' =&gt; ['type' =&gt; 'string']\n    ]\n];\n\n\/\/ \u4f7f\u7528\u4f8b\ntry {\n    \/\/ API\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30b7\u30df\u30e5\u30ec\u30fc\u30c8\n    $apiResponse = json_decode('{\"location\":{\"name\":\"Tokyo\",\"country\":\"Japan\"},\"current\":{\"temp_c\":\"28.5\",\"condition\":{\"text\":\"Sunny\"}},\"updated_at\":\"2023-08-15T12:30:00Z\"}', true);\n    \n    $validator = new SchemaValidator();\n    $validatedData = $validator-&gt;validate($apiResponse, $weatherSchema);\n    \n    \/\/ \u691c\u8a3c\u6e08\u307f\u30c7\u30fc\u30bf\u3092\u6574\u5f62\n    $weatherData = [\n        'city' =&gt; $validatedData['location']['name'],\n        'country' =&gt; $validatedData['location']['country'],\n        'temperature' =&gt; $validatedData['current']['temp_c'],\n        'condition' =&gt; $validatedData['current']['condition']['text'],\n        'updated_at' =&gt; $validatedData['updated_at']\n    ];\n    \n    echo \"\u73fe\u5728\u306e {$weatherData['city']} ({$weatherData['country']}) \u306e\u5929\u6c17\uff1a\\n\";\n    echo \"\u6c17\u6e29: {$weatherData['temperature']}\u2103\\n\";\n    echo \"\u72b6\u614b: {$weatherData['condition']}\\n\";\n    echo \"\u66f4\u65b0: {$weatherData['updated_at']}\\n\";\n} catch (Exception $e) {\n    echo \"\u30a8\u30e9\u30fc: \" . $e-&gt;getMessage() . \"\\n\";\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-117\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u691c\u8a3c\u306e\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u6d3b\u7528<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u65e2\u5b58\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u6d3b\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u5805\u7262\u3067\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3057\u3084\u3059\u3044\u578b\u691c\u8a3c\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002\u4ee3\u8868\u7684\u306aPHP\u306e\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Respect\\Validation<\/strong> \u2013 \u67d4\u8edf\u304b\u3064\u8868\u73fe\u529b\u8c4a\u304b\u306a\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n\n\n\n<li><strong>JSON Schema<\/strong> \u2013 JSON\u5f62\u5f0f\u306e\u30c7\u30fc\u30bf\u3092\u691c\u8a3c\u3059\u308b\u305f\u3081\u306e\u6a19\u6e96\u898f\u683c<\/li>\n\n\n\n<li><strong>symfony\/validator<\/strong> \u2013 Symfony\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/li>\n\n\n\n<li><strong>rakit\/validation<\/strong> \u2013 \u30b7\u30f3\u30d7\u30eb\u3067\u62e1\u5f35\u6027\u306e\u9ad8\u3044\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n<\/ol>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u3088\u308a\u5ba3\u8a00\u7684\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044API\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u691c\u8a3c\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-118\">API\u30ec\u30b9\u30dd\u30f3\u30b9\u691c\u8a3c\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5e38\u306b\u578b\u3092\u8003\u616e\u3059\u308b<\/strong>: API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u3001\u5e38\u306b\u578b\u3092\u8003\u616e\u3057\u3066\u691c\u8a3c\u3057\u307e\u3057\u3087\u3046\u3002\u7279\u306b\u3001\u6570\u5024\u304c\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u308b\u5834\u5408\u3084\u3001null\u304c\u542b\u307e\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30a8\u30e9\u30fc\u30b1\u30fc\u30b9\u3092\u7d30\u304b\u304f\u5206\u3051\u3066\u51e6\u7406\u3059\u308b<\/strong>: API\u63a5\u7d9a\u30a8\u30e9\u30fc\u3001JSON\u30c7\u30b3\u30fc\u30c9\u30a8\u30e9\u30fc\u3001\u30b9\u30ad\u30fc\u30de\u691c\u8a3c\u30a8\u30e9\u30fc\u306a\u3069\u3001\u30a8\u30e9\u30fc\u30b1\u30fc\u30b9\u3092\u7d30\u304b\u304f\u5206\u3051\u3066\u51e6\u7406\u3059\u308b\u3053\u3068\u3067\u3001\u554f\u984c\u306e\u7279\u5b9a\u3068\u5bfe\u5fdc\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">try {\n    $weatherData = getWeatherData('Tokyo');\n    \/\/ \u6210\u529f\u6642\u306e\u51e6\u7406\n} catch (ConnectionException $e) {\n    \/\/ API\u63a5\u7d9a\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n    logError('api_connection', $e-&gt;getMessage());\n    showError('API\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3057\u3070\u3089\u304f\u3057\u3066\u304b\u3089\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');\n} catch (JsonException $e) {\n    \/\/ JSON\u30d1\u30fc\u30b9\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n    logError('json_parse', $e-&gt;getMessage());\n    showError('\u30c7\u30fc\u30bf\u306e\u89e3\u6790\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30b5\u30dd\u30fc\u30c8\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002');\n} catch (ValidationException $e) {\n    \/\/ \u691c\u8a3c\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n    logError('validation', $e-&gt;getMessage());\n    showError('\u7121\u52b9\u306a\u30c7\u30fc\u30bf\u5f62\u5f0f\u3067\u3059\u3002\u30b5\u30dd\u30fc\u30c8\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002');\n} catch (Exception $e) {\n    \/\/ \u305d\u306e\u4ed6\u306e\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n    logError('general', $e-&gt;getMessage());\n    showError('\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u3057\u3070\u3089\u304f\u3057\u3066\u304b\u3089\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');\n}\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u578b\u5909\u63db\u3092\u660e\u793a\u7684\u306b\u884c\u3046<\/strong>: \u7279\u306b\u6570\u5024\u304c\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u308b\u5834\u5408\u306a\u3069\u3001\u9069\u5207\u306a\u578b\u3078\u306e\u5909\u63db\u3092\u660e\u793a\u7684\u306b\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u660e\u793a\u7684\u306a\u578b\u5909\u63db\n$temperature = (float) $data['current']['temp_c'];\n$isActive = (bool) $data['is_active'];\n$userId = (int) $data['user_id'];\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u90e8\u5206\u7684\u306a\u691c\u8a3c\u3092\u884c\u3046<\/strong>: API\u5fdc\u7b54\u306e\u4e00\u90e8\u3060\u3051\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u5fc5\u8981\u306a\u90e8\u5206\u3060\u3051\u3092\u691c\u8a3c\u3059\u308b\u3053\u3068\u3067\u3001\u7121\u99c4\u306a\u51e6\u7406\u3092\u6e1b\u3089\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6d3b\u7528<\/strong>: \u983b\u7e41\u306b\u547c\u3073\u51fa\u3059API\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u5411\u4e0a\u3068\u5916\u90e8\u4f9d\u5b58\u306e\u8efd\u6e1b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function getWeatherDataWithCache(string $cityName, int $cacheTime = 1800): array {\n    $cacheKey = \"weather_data_{$cityName}\";\n    \n    \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\n    $cachedData = getCache($cacheKey);\n    if ($cachedData !== null) {\n        return $cachedData;\n    }\n    \n    \/\/ API\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\n    $weatherData = getWeatherData($cityName);\n    \n    \/\/ \u30c7\u30fc\u30bf\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u4fdd\u5b58\n    setCache($cacheKey, $weatherData, $cacheTime);\n    \n    return $weatherData;\n}\n<\/pre>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li><strong>\u30d0\u30fc\u30b8\u30e7\u30f3\u4e92\u63db\u6027\u3092\u8003\u616e\u3059\u308b<\/strong>: API\u306f\u4e88\u544a\u306a\u304f\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u30d0\u30fc\u30b8\u30e7\u30f3\u4e92\u63db\u6027\u3092\u8003\u616e\u3057\u3066\u3001\u691c\u8a3c\u30ed\u30b8\u30c3\u30af\u3092\u8a2d\u8a08\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<p>PHP\u306e\u578b\u78ba\u8a8d\u6a5f\u80fd\u3092\u6d3b\u7528\u3057\u305fAPI\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u691c\u8a3c\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u306b\u8d77\u56e0\u3059\u308b\u30d0\u30b0\u3084\u30a8\u30e9\u30fc\u3092\u5927\u5e45\u306b\u6e1b\u3089\u3057\u3001\u3088\u308a\u5805\u7262\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001\u8907\u6570\u306eAPI\u3092\u4f7f\u7528\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u3084\u3001\u91cd\u8981\u306a\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306bAPI\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u3067\u306f\u3001\u5165\u5ff5\u306a\u578b\u78ba\u8a8d\u3068\u691c\u8a3c\u304c\u4e0d\u53ef\u6b20\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-119\">\u307e\u3068\u3081\uff1aPHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u91cd\u8981\u6027\u304b\u3089\u59cb\u307e\u308a\u3001\u57fa\u672c\u7684\u306a\u95a2\u6570\uff08<code>gettype()<\/code>\u3001<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3001<code>var_dump()<\/code>\uff09\u306e\u4f7f\u3044\u65b9\u3001PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u6a5f\u80fd\u3001PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3001\u305d\u3057\u3066\u5b9f\u969b\u306e\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u307e\u3067\u8a73\u3057\u304f\u898b\u3066\u304d\u307e\u3057\u305f\u3002\u3053\u3053\u3067\u306f\u3001PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u307e\u3068\u3081\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-120\">\u7528\u9014\u306b\u5fdc\u3058\u305f\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u9078\u3073\u65b9<\/h3>\n\n\n\n<p>PHP\u306b\u306f\u69d8\u3005\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u6700\u9069\u306a\u65b9\u6cd5\u3092\u9078\u3076\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n\n\n<div id=\"id-191e4d31-0af9-474c-a450-32dd59133177\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u578b\u78ba\u8a8d\u65b9\u6cd5<\/th><th>\u6700\u9069\u306a\u7528\u9014<\/th><th>\u5229\u70b9<\/th><th>\u5236\u9650<\/th><\/tr><\/thead><tbody><tr><td><code>gettype()<\/code><\/td><td>\u5909\u6570\u306e\u578b\u540d\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408<\/td><td>\u30b7\u30f3\u30d7\u30eb\u3067\u76f4\u611f\u7684<\/td><td>\u578b\u540d\u306e\u6587\u5b57\u5217\u6bd4\u8f03\u304c\u5fc5\u8981<\/td><\/tr><tr><td><code>is_*()<\/code>\u7cfb\u95a2\u6570<\/td><td>\u7279\u5b9a\u306e\u578b\u304b\u3069\u3046\u304b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u5834\u5408<\/td><td>\u9ad8\u901f\u3067\u76f4\u63a5\u7684\u3001\u53ef\u8aad\u6027\u304c\u9ad8\u3044<\/td><td>\u578b\u3054\u3068\u306b\u500b\u5225\u306e\u95a2\u6570\u304c\u5fc5\u8981<\/td><\/tr><tr><td><code>var_dump()<\/code><\/td><td>\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u578b\u3068\u5024\u3092\u8a73\u7d30\u306b\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408<\/td><td>\u8a73\u7d30\u306a\u60c5\u5831\u8868\u793a\u3001\u30cd\u30b9\u30c8\u3055\u308c\u305f\u69cb\u9020\u3082\u8868\u793a<\/td><td>\u51fa\u529b\u304c\u5197\u9577\u3001\u672c\u756a\u74b0\u5883\u3067\u306f\u4e0d\u9069\u5207<\/td><\/tr><tr><td>\u578b\u5ba3\u8a00\uff08PHP 7+\uff09<\/td><td>\u95a2\u6570\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u3092\u5f37\u5236\u3057\u305f\u3044\u5834\u5408<\/td><td>\u30b3\u30fc\u30c9\u81ea\u5df1\u6587\u66f8\u5316\u3001\u65e9\u671f\u30a8\u30e9\u30fc\u691c\u51fa<\/td><td>\u5909\u6570\u81ea\u4f53\u306b\u306f\u4f7f\u3048\u306a\u3044<\/td><\/tr><tr><td><code>instanceof<\/code><\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30af\u30e9\u30b9\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3044\u5834\u5408<\/td><td>\u30af\u30e9\u30b9\u968e\u5c64\u3092\u8003\u616e\u3067\u304d\u308b<\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5c02\u7528<\/td><\/tr><tr><td>\u30de\u30c3\u30c1\u5f0f\uff08PHP 8+\uff09<\/td><td>\u578b\u3068\u5024\u306e\u4e21\u65b9\u306b\u57fa\u3065\u3044\u3066\u51e6\u7406\u3092\u5206\u5c90\u3055\u305b\u305f\u3044\u5834\u5408<\/td><td>\u7c21\u6f54\u3067\u8868\u73fe\u529b\u8c4a\u304b<\/td><td>PHP 8\u4ee5\u964d\u3067\u306e\u307f\u5229\u7528\u53ef\u80fd<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"i-121\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/h3>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u30b3\u30fc\u30c9\u306e\u5805\u7262\u6027\u3092\u9ad8\u3081\u308b\u4e00\u65b9\u3067\u3001\u904e\u5ea6\u306a\u4f7f\u7528\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><code>is_*()<\/code>\u7cfb\u95a2\u6570\u306f<code>gettype()<\/code>\u3088\u308a\u9ad8\u901f<\/strong>: \u7279\u5b9a\u306e\u578b\u3060\u3051\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408\u306f\u3001<code>gettype()<\/code>\u3067\u6587\u5b57\u5217\u6bd4\u8f03\u3059\u308b\u3088\u308a\u3082<code>is_*()<\/code>\u7cfb\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u65b9\u304c\u52b9\u7387\u7684\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u91cd\u8907\u3059\u308b\u578b\u30c1\u30a7\u30c3\u30af\u3092\u907f\u3051\u308b<\/strong>: \u540c\u3058\u5909\u6570\u306b\u5bfe\u3057\u3066\u8907\u6570\u56de\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u306e\u3067\u306f\u306a\u304f\u3001\u5fc5\u8981\u306a\u7b87\u6240\u3067\u4e00\u5ea6\u3060\u3051\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>\u30db\u30c3\u30c8\u30d1\u30b9\u3067\u306e\u578b\u78ba\u8a8d\u3092\u6700\u9069\u5316<\/strong>: \u983b\u7e41\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b3\u30fc\u30c9\u30d1\u30b9\u3067\u306f\u3001\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u578b\u78ba\u8a8d\u306b\u3068\u3069\u3081\u3001\u53ef\u80fd\u306a\u9650\u308a\u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong><code>var_dump()<\/code>\u306f\u958b\u767a\u74b0\u5883\u3067\u306e\u307f\u4f7f\u7528<\/strong>: <code>var_dump()<\/code>\u306f\u8a73\u7d30\u306a\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u307e\u3059\u304c\u3001\u51e6\u7406\u304c\u91cd\u3044\u305f\u3081\u672c\u756a\u74b0\u5883\u3067\u306f\u4f7f\u7528\u3092\u907f\u3051\u308b\u3079\u304d\u3067\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6d3b\u7528<\/strong>: \u540c\u3058\u578b\u30c1\u30a7\u30c3\u30af\u3092\u7e70\u308a\u8fd4\u3057\u884c\u3046\u5834\u5408\u306f\u3001\u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u3059\u308b\u3053\u3068\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u8003\u616e\u3057\u305f\u578b\u30c1\u30a7\u30c3\u30af\nfunction process($data) {\n    static $cache = []; \/\/ \u9759\u7684\u30ad\u30e3\u30c3\u30b7\u30e5\n    \n    \/\/ \u30c7\u30fc\u30bf\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u8a08\u7b97\n    $hash = md5(serialize($data));\n    \n    \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u3042\u308b\u304b\u78ba\u8a8d\n    if (isset($cache[$hash])) {\n        return $cache[$hash];\n    }\n    \n    \/\/ \u578b\u306b\u57fa\u3065\u3044\u305f\u51e6\u7406\n    $result = match (true) {\n        is_array($data) =&gt; processArray($data),\n        is_object($data) =&gt; processObject($data),\n        is_string($data) =&gt; processString($data),\n        is_numeric($data) =&gt; processNumber($data),\n        default =&gt; throw new InvalidArgumentException(\"Unsupported data type: \" . gettype($data))\n    };\n    \n    \/\/ \u7d50\u679c\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u4fdd\u5b58\n    $cache[$hash] = $result;\n    \n    return $result;\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-122\">PHP 7\u30688\u3067\u306e\u578b\u95a2\u9023\u6a5f\u80fd\u306e\u6d3b\u7528\u30dd\u30a4\u30f3\u30c8<\/h3>\n\n\n\n<p>PHP 7\u4ee5\u964d\u3067\u306f\u578b\u5ba3\u8a00\u304c\u5f37\u5316\u3055\u308c\u3001PHP 8\u3067\u306f\u3055\u3089\u306b\u591a\u304f\u306e\u578b\u95a2\u9023\u6a5f\u80fd\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u30dd\u30a4\u30f3\u30c8\u3092\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u306a\u30bf\u30a4\u30d7\u30c1\u30a7\u30c3\u30af\u3092\u6709\u52b9\u306b\u3059\u308b<\/strong>: \u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u306b<code>declare(strict_types=1);<\/code>\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u623b\u308a\u5024\u578b\u3092\u5e38\u306b\u6307\u5b9a\u3059\u308b<\/strong>: \u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u578b\u3092\u5e38\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u5b89\u5168\u6027\u3068\u8aad\u307f\u3084\u3059\u3055\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u5171\u7528\u578b\u3092\u6d3b\u7528\u3059\u308b\uff08PHP 8+\uff09<\/strong>: \u8907\u6570\u306e\u578b\u3092\u8a31\u5bb9\u3059\u308b\u5834\u5408\u306f\u3001\u5171\u7528\u578b\uff08<code>int|float<\/code>\u306a\u3069\uff09\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>null\u8a31\u5bb9\u578b\u3092\u9069\u5207\u306b\u4f7f\u7528\u3059\u308b<\/strong>: null\u5024\u3092\u8a31\u5bb9\u3059\u308b\u5834\u5408\u306f\u3001<code>?<\/code>\u6f14\u7b97\u5b50\uff08<code>?string<\/code>\u306a\u3069\uff09\u3092\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>\u30de\u30c3\u30c1\u5f0f\u3067\u578b\u306b\u57fa\u3065\u304f\u51e6\u7406\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3059\u308b\uff08PHP 8+\uff09<\/strong>: \u578b\u306b\u57fa\u3065\u3044\u305f\u6761\u4ef6\u5206\u5c90\u306f\u3001\u30de\u30c3\u30c1\u5f0f\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3088\u308a\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 8\u3067\u306e\u578b\u6a5f\u80fd\u306e\u6d3b\u7528\u4f8b\ndeclare(strict_types=1);\n\nfunction calculateValue(int|float $number, ?string $format = null): string {\n    $result = match (true) {\n        is_int($number) =&gt; $number * 2,\n        is_float($number) &amp;&amp; $number &gt; 0 =&gt; sqrt($number),\n        is_float($number) =&gt; abs($number),\n        default =&gt; throw new InvalidArgumentException(\"Invalid number type\")\n    };\n    \n    if ($format === null) {\n        return (string)$result;\n    }\n    \n    return sprintf($format, $result);\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-123\">\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h3>\n\n\n\n<p>\u9ad8\u54c1\u8cea\u306aPHP\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u3092\u4ee5\u4e0b\u306b\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-124\">\u958b\u767a\u6642\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] \u3059\u3079\u3066\u306e\u95a2\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306b\u5f15\u6570\u306e\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u3059\u3079\u3066\u306e\u95a2\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306b\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u306b\u306f<code>declare(strict_types=1);<\/code>\u3092\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3084API\u30ec\u30b9\u30dd\u30f3\u30b9\u306a\u3069\u306e\u5916\u90e8\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u9069\u5207\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u30b3\u30fc\u30c9\u3067\u306f\u3001\u9069\u5207\u306a\u5834\u9762\u3067<code>instanceof<\/code>\u30c1\u30a7\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] PHP 8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30de\u30c3\u30c1\u5f0f\u3092\u6d3b\u7528\u3057\u3066\u578b\u306b\u57fa\u3065\u304f\u6761\u4ef6\u5206\u5c90\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u30c7\u30d0\u30c3\u30b0\u30b3\u30fc\u30c9\uff08<code>var_dump()<\/code>\u306a\u3069\uff09\u304c\u672c\u756a\u74b0\u5883\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-125\">\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u6642\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] \u578b\u5ba3\u8a00\u3068\u5b9f\u969b\u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u77db\u76fe\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u4e0d\u5fc5\u8981\u307e\u305f\u306f\u91cd\u8907\u3059\u308b\u578b\u30c1\u30a7\u30c3\u30af\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u578b\u5909\u63db\u306f\u660e\u793a\u7684\u306b\u884c\u308f\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u578b\u306b\u95a2\u3059\u308b\u4f8b\u5916\u304c\u9069\u5207\u306b\u51e6\u7406\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u6761\u4ef6\u5206\u5c90\u306e\u9806\u5e8f\u306f\u9069\u5207\u304b\uff08\u3088\u308a\u5177\u4f53\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u5148\u306b\u884c\u308f\u308c\u3066\u3044\u308b\u304b\uff09\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-126\">\u7d99\u7d9a\u7684\u306a\u6539\u5584\u306e\u305f\u3081\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] \u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\uff08PHPStan\u3001Psalm\u3001PHP_CodeSniffer\u306a\u3069\uff09\u3092\u4f7f\u7528\u3057\u3066\u578b\u306e\u554f\u984c\u3092\u691c\u51fa\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u578b\u306b\u95a2\u3059\u308b\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u30c1\u30fc\u30e0\u5185\u3067\u578b\u5ba3\u8a00\u3068\u578b\u30c1\u30a7\u30c3\u30af\u306b\u95a2\u3059\u308b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3092\u5b9a\u3081\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n\n\n\n<li>[ ] \u65b0\u3057\u3044PHP\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u578b\u95a2\u9023\u6a5f\u80fd\u306b\u3064\u3044\u3066\u7d99\u7d9a\u7684\u306b\u5b66\u7fd2\u3057\u3066\u3044\u307e\u3059\u304b\uff1f<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-127\">\u5c06\u6765\u7684\u306aPHP\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u5c55\u671b<\/h3>\n\n\n\n<p>PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u306f\u7d99\u7d9a\u7684\u306b\u9032\u5316\u3057\u3066\u304a\u308a\u3001\u5c06\u6765\u7684\u306b\u306f\u3055\u3089\u306b\u5f37\u529b\u306b\u306a\u308b\u3053\u3068\u304c\u4e88\u60f3\u3055\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u5f37\u5316<\/strong>: PHP 8.1\u3067\u306fReadonly Properties\u304c\u5c0e\u5165\u3055\u308c\u3001PHP 8.2\u3067\u306freadonly classes\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u4eca\u5f8c\u3082\u578b\u306b\u95a2\u3059\u308b\u6a5f\u80fd\u306e\u5f37\u5316\u304c\u671f\u5f85\u3055\u308c\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30b8\u30a7\u30cd\u30ea\u30af\u30b9<\/strong>: PHP\u30b3\u30df\u30e5\u30cb\u30c6\u30a3\u3067\u306f\u3001\u30b8\u30a7\u30cd\u30ea\u30af\u30b9\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u578b\uff09\u306e\u5c0e\u5165\u304c\u691c\u8a0e\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u914d\u5217\u3084\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u8981\u7d20\u306e\u578b\u3092\u3088\u308a\u53b3\u683c\u306b\u5236\u5fa1\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>\u578b\u63a8\u8ad6\u306e\u5411\u4e0a<\/strong>: \u5c06\u6765\u7684\u306b\u306f\u3001\u578b\u63a8\u8ad6\uff08\u5909\u6570\u306e\u578b\u3092\u81ea\u52d5\u7684\u306b\u63a8\u6e2c\u3059\u308b\u6a5f\u80fd\uff09\u304c\u5411\u4e0a\u3057\u3001\u3088\u308a\u5c11\u306a\u3044\u578b\u5ba3\u8a00\u3067\u3082\u5b89\u5168\u306a\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/li>\n\n\n\n<li><strong>\u9759\u7684\u578b\u4ed8\u3051\u306e\u30aa\u30d7\u30b7\u30e7\u30f3<\/strong>: PHP\u306f\u52d5\u7684\u578b\u4ed8\u3051\u8a00\u8a9e\u3067\u3059\u304c\u3001\u5c06\u6765\u7684\u306b\u306f\u5b8c\u5168\u306a\u9759\u7684\u578b\u4ed8\u3051\u30e2\u30fc\u30c9\u304c\u9078\u629e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u53ef\u80fd\u6027\u3082\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-128\">\u6b21\u306e\u30b9\u30c6\u30c3\u30d7<\/h3>\n\n\n\n<p>PHP\u306e\u578b\u78ba\u8a8d\u3068\u578b\u5ba3\u8a00\u306b\u3064\u3044\u3066\u306e\u7406\u89e3\u3092\u6df1\u3081\u308b\u305f\u3081\u306e\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u306e\u6d3b\u7528<\/strong>: PHPStan\u3001Psalm\u3001PHP_CodeSniffer\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3057\u3001\u578b\u306b\u95a2\u3059\u308b\u554f\u984c\u3092\u81ea\u52d5\u691c\u51fa\u3059\u308b\u4ed5\u7d44\u307f\u3092\u69cb\u7bc9\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>PHP 8\u3078\u306e\u79fb\u884c<\/strong>: \u307e\u3060PHP 7\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001PHP 8\u3078\u306e\u79fb\u884c\u3092\u691c\u8a0e\u3057\u307e\u3057\u3087\u3046\u3002\u5171\u7528\u578b\u3001\u30de\u30c3\u30c1\u5f0f\u306a\u3069\u3001\u3088\u308a\u5f37\u529b\u306a\u578b\u95a2\u9023\u6a5f\u80fd\u3092\u6d3b\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u30bf\u30a4\u30d7\u30bb\u30fc\u30d5\u306a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306e\u7fd2\u6163\u5316<\/strong>: \u65b0\u3057\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u969b\u306f\u3001\u5e38\u306b\u578b\u5ba3\u8a00\u3092\u4f7f\u7528\u3057\u3001\u5916\u90e8\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u306f\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u3053\u3068\u3092\u7fd2\u6163\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n\n\n\n<li><strong>\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2<\/strong>: PHP\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u306f\u9032\u5316\u3057\u7d9a\u3051\u3066\u3044\u308b\u305f\u3081\u3001\u6700\u65b0\u306e\u6a5f\u80fd\u3084\u63a8\u5968\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306b\u3064\u3044\u3066\u7d99\u7d9a\u7684\u306b\u5b66\u7fd2\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-129\">\u307e\u3068\u3081<\/h3>\n\n\n\n<p>PHP\u306b\u304a\u3051\u308b\u578b\u78ba\u8a8d\u306f\u3001\u30d0\u30b0\u306e\u65e9\u671f\u767a\u898b\u3001\u30b3\u30fc\u30c9\u306e\u81ea\u5df1\u6587\u66f8\u5316\u3001\u4fdd\u5b88\u6027\u306e\u5411\u4e0a\u306a\u3069\u3001\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u3092\u3082\u305f\u3089\u3057\u307e\u3059\u3002\u9069\u5207\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u3092\u9078\u3073\u3001\u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u54c1\u8cea\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001PHP 7\u4ee5\u964d\u3067\u5f37\u5316\u3055\u308c\u305f\u578b\u5ba3\u8a00\u6a5f\u80fd\u3068PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u578b\u306b\u95a2\u3059\u308b\u591a\u304f\u306e\u554f\u984c\u3092\u672a\u7136\u306b\u9632\u3050\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u5358\u306a\u308b\u6280\u8853\u7684\u306a\u8a73\u7d30\u3067\u306f\u306a\u304f\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u7fd2\u6163\u3067\u3059\u3002\u65e5\u5e38\u7684\u306a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u304a\u3044\u3066\u578b\u3092\u610f\u8b58\u3057\u3001\u9069\u5207\u306a\u578b\u78ba\u8a8d\u3068\u578b\u5ba3\u8a00\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u3088\u308a\u4fe1\u983c\u6027\u306e\u9ad8\u3044PHP\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-130\">\u7528\u9014\u306b\u5fdc\u3058\u305f\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u9078\u3073\u65b9\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/h3>\n\n\n\n<p>PHP\u306b\u306f\u8907\u6570\u306e\u578b\u78ba\u8a8d\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u305d\u308c\u305e\u308c\u306b\u9577\u6240\u3068\u77ed\u6240\u304c\u3042\u308a\u307e\u3059\u3002\u9069\u5207\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u3092\u9078\u3076\u3053\u3068\u306f\u3001\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u3084\u3059\u3055\u3060\u3051\u3067\u306a\u304f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u3082\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u5404\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u7279\u5fb4\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-131\">\u5404\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u6bd4\u8f03<\/h4>\n\n\n\n<p>PHP\u306e\u4e3b\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u306e\u7279\u5fb4\u3092\u4ee5\u4e0b\u306e\u8868\u3067\u6bd4\u8f03\u3057\u307e\u3059\uff1a<\/p>\n\n\n<div id=\"id-3346c4cc-5c7d-4eb0-b69c-4f5576fb8c37\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u578b\u78ba\u8a8d\u65b9\u6cd5<\/th><th>\u901f\u5ea6<\/th><th>\u8a73\u7d30\u5ea6<\/th><th>\u4f7f\u3044\u3084\u3059\u3055<\/th><th>\u6700\u9069\u306a\u4f7f\u7528\u30b7\u30ca\u30ea\u30aa<\/th><\/tr><\/thead><tbody><tr><td><code>is_*()<\/code>\u7cfb\u95a2\u6570<\/td><td>\u901f\u3044<\/td><td>\u4f4e\uff08\u7279\u5b9a\u306e\u578b\u306e\u307f\uff09<\/td><td>\u9ad8\u3044<\/td><td>\u7279\u5b9a\u306e\u578b\u3092\u7d20\u65e9\u304f\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408<\/td><\/tr><tr><td><code>gettype()<\/code><\/td><td>\u4e2d\u7a0b\u5ea6<\/td><td>\u4e2d\u7a0b\u5ea6<\/td><td>\u4e2d\u7a0b\u5ea6<\/td><td>\u578b\u540d\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u53d6\u5f97\u3059\u308b\u5834\u5408<\/td><\/tr><tr><td><code>var_dump()<\/code><\/td><td>\u9045\u3044<\/td><td>\u975e\u5e38\u306b\u9ad8\u3044<\/td><td>\u9ad8\u3044<\/td><td>\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u8a73\u7d30\u306a\u578b\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b\u5834\u5408<\/td><\/tr><tr><td>\u578b\u5ba3\u8a00<\/td><td>\u975e\u5e38\u306b\u901f\u3044<\/td><td>\u4e2d\u7a0b\u5ea6<\/td><td>\u9ad8\u3044<\/td><td>\u95a2\u6570\u306e\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u3092\u5f37\u5236\u3059\u308b\u5834\u5408<\/td><\/tr><tr><td><code>instanceof<\/code><\/td><td>\u4e2d\u7a0b\u5ea6<\/td><td>\u9ad8\u3044\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09<\/td><td>\u9ad8\u3044<\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u3084\u968e\u5c64\u95a2\u4fc2\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u5834\u5408<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u3053\u306e\u6bd4\u8f03\u304b\u3089\u5206\u304b\u308b\u3088\u3046\u306b\u3001\u5404\u578b\u78ba\u8a8d\u65b9\u6cd5\u306b\u306f\u5f97\u610f\u306a\u5834\u9762\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u3067\u306f\u3001\u5177\u4f53\u7684\u306a\u30b7\u30ca\u30ea\u30aa\u3054\u3068\u306b\u6700\u9069\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-132\">\u30b7\u30ca\u30ea\u30aa\u5225\u306e\u6700\u9069\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5<\/h4>\n\n\n\n<p><strong>\u30b7\u30ca\u30ea\u30aa1: \u7279\u5b9a\u306e\u578b\u304b\u3069\u3046\u304b\u3092\u7d20\u65e9\u304f\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u6700\u3082\u5358\u7d14\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3067\u306f\u3001<code>is_*()<\/code>\u7cfb\u95a2\u6570\u304c\u6700\u9069\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u3044\u4f8b: is_*()\u7cfb\u95a2\u6570\u3092\u4f7f\u7528\nfunction processValue($value) {\n    if (is_int($value)) {\n        return $value * 2;\n    } elseif (is_string($value)) {\n        return strtoupper($value);\n    } elseif (is_array($value)) {\n        return count($value);\n    } else {\n        return null;\n    }\n}\n<\/pre>\n\n\n\n<p><strong>\u30b7\u30ca\u30ea\u30aa2: \u5909\u6570\u306e\u578b\u306b\u57fa\u3065\u3044\u3066\u5206\u5c90\u51e6\u7406\u3092\u884c\u3046<\/strong><\/p>\n\n\n\n<p>\u8907\u6570\u306e\u578b\u306b\u5bfe\u3057\u3066\u7570\u306a\u308b\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u3001PHP 8\u3067\u306f\u30de\u30c3\u30c1\u5f0f\u304c\u6700\u9069\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u3044\u4f8b: PHP 8\u306e\u30de\u30c3\u30c1\u5f0f\u3092\u4f7f\u7528\nfunction processValue($value) {\n    return match (true) {\n        is_int($value) =&gt; $value * 2,\n        is_string($value) =&gt; strtoupper($value),\n        is_array($value) =&gt; count($value),\n        default =&gt; null\n    };\n}\n<\/pre>\n\n\n\n<p>PHP 7\u4ee5\u524d\u3067\u306f\u3001<code>gettype()<\/code>\u3068<code>switch<\/code>\u6587\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u8aad\u307f\u3084\u3059\u3044\u9078\u629e\u80a2\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ PHP 7\u4ee5\u524d\u3067\u306e\u4ee3\u66ff\u65b9\u6cd5\nfunction processValue($value) {\n    switch (gettype($value)) {\n        case 'integer':\n            return $value * 2;\n        case 'string':\n            return strtoupper($value);\n        case 'array':\n            return count($value);\n        default:\n            return null;\n    }\n}\n<\/pre>\n\n\n\n<p><strong>\u30b7\u30ca\u30ea\u30aa3: \u95a2\u6570\u306e\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u3092\u5f37\u5236\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u306e\u578b\u30c1\u30a7\u30c3\u30af\u306b\u306f\u3001\u578b\u5ba3\u8a00\u304c\u6700\u9069\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u3044\u4f8b: \u578b\u5ba3\u8a00\u3092\u4f7f\u7528\nfunction processInteger(int $value): int {\n    return $value * 2;\n}\n\nfunction processString(string $value): string {\n    return strtoupper($value);\n}\n\nfunction processArray(array $values): int {\n    return count($values);\n}\n<\/pre>\n\n\n\n<p><strong>\u30b7\u30ca\u30ea\u30aa4: \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u3084\u30af\u30e9\u30b9\u968e\u5c64\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u578b\u78ba\u8a8d\u306b\u306f\u3001<code>instanceof<\/code>\u6f14\u7b97\u5b50\u304c\u6700\u9069\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u826f\u3044\u4f8b: instanceof\u3092\u4f7f\u7528\nfunction processObject($object) {\n    if ($object instanceof User) {\n        return $object-&gt;getName();\n    } elseif ($object instanceof Product) {\n        return $object-&gt;getTitle();\n    } elseif ($object instanceof Serializable) {\n        return serialize($object);\n    } else {\n        return null;\n    }\n}\n<\/pre>\n\n\n\n<p><strong>\u30b7\u30ca\u30ea\u30aa5: \u30c7\u30d0\u30c3\u30b0\u6642\u306b\u8a73\u7d30\u306a\u578b\u60c5\u5831\u3092\u78ba\u8a8d\u3059\u308b<\/strong><\/p>\n\n\n\n<p>\u30c7\u30d0\u30c3\u30b0\u6642\u306b\u306f\u3001<code>var_dump()<\/code>\u304c\u6700\u3082\u8a73\u7d30\u306a\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30c7\u30d0\u30c3\u30b0\u7528\u9014\u306e\u307f: var_dump()\u3092\u4f7f\u7528\nfunction debug($value) {\n    echo '&lt;pre&gt;';\n    var_dump($value);\n    echo '&lt;\/pre&gt;';\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-133\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff\u3068\u6700\u9069\u5316<\/h4>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u30b3\u30fc\u30c9\u306e\u5b89\u5168\u6027\u3092\u9ad8\u3081\u308b\u4e00\u65b9\u3067\u3001\u904e\u5ea6\u306a\u4f7f\u7528\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u60aa\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u89b3\u70b9\u304b\u3089\u8003\u616e\u3059\u3079\u304d\u30dd\u30a4\u30f3\u30c8\u3092\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<p><strong>1. \u578b\u78ba\u8a8d\u30e1\u30bd\u30c3\u30c9\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6bd4\u8f03<\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001\u5404\u578b\u78ba\u8a8d\u30e1\u30bd\u30c3\u30c9\u306e\u76f8\u5bfe\u7684\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u793a\u3059\u3082\u306e\u3067\u3059\uff08\u6570\u5024\u304c\u4f4e\u3044\u307b\u3069\u9ad8\u901f\uff09\uff1a<\/p>\n\n\n<div id=\"id-1f09e42a-86d1-41c2-ab2f-3deea469d556\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u578b\u78ba\u8a8d\u65b9\u6cd5<\/th><th>\u76f8\u5bfe\u7684\u306a\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30b3\u30b9\u30c8<\/th><\/tr><\/thead><tbody><tr><td>\u578b\u5ba3\u8a00<\/td><td>1 (\u6700\u901f)<\/td><\/tr><tr><td><code>is_*()<\/code>\u7cfb\u95a2\u6570<\/td><td>2<\/td><\/tr><tr><td><code>instanceof<\/code><\/td><td>3<\/td><\/tr><tr><td><code>gettype()<\/code><\/td><td>5<\/td><\/tr><tr><td><code>var_dump()<\/code><\/td><td>10+<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p><strong>2. \u5197\u9577\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u907f\u3051\u308b<\/strong><\/p>\n\n\n\n<p>\u540c\u3058\u5909\u6570\u306b\u5bfe\u3057\u3066\u8907\u6570\u56de\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u306e\u306f\u975e\u52b9\u7387\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b: \u5197\u9577\u306a\u578b\u30c1\u30a7\u30c3\u30af\nfunction processArray($arr) {\n    if (!is_array($arr)) {\n        return false;\n    }\n    \n    foreach ($arr as $item) {\n        \/\/ \u5404\u30eb\u30fc\u30d7\u3067\u540c\u3058\u30c1\u30a7\u30c3\u30af\u3092\u7e70\u308a\u8fd4\u3059\n        if (is_string($item)) {\n            echo strtoupper($item);\n        }\n        if (is_int($item)) {\n            echo $item * 2;\n        }\n    }\n}\n\n\/\/ \u826f\u3044\u4f8b: \u578b\u60c5\u5831\u3092\u30ad\u30e3\u30c3\u30b7\u30e5\nfunction processArray($arr) {\n    if (!is_array($arr)) {\n        return false;\n    }\n    \n    foreach ($arr as $item) {\n        \/\/ \u4e00\u5ea6\u3060\u3051\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\n        $type = gettype($item);\n        \n        if ($type === 'string') {\n            echo strtoupper($item);\n        } elseif ($type === 'integer') {\n            echo $item * 2;\n        }\n    }\n}\n<\/pre>\n\n\n\n<p><strong>3. \u30db\u30c3\u30c8\u30d1\u30b9\u3067\u306e\u578b\u78ba\u8a8d\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b<\/strong><\/p>\n\n\n\n<p>\u983b\u7e41\u306b\u5b9f\u884c\u3055\u308c\u308b\u30b3\u30fc\u30c9\u30d1\u30b9\uff08\u30db\u30c3\u30c8\u30d1\u30b9\uff09\u3067\u306f\u3001\u578b\u78ba\u8a8d\u3092\u3067\u304d\u308b\u3060\u3051\u5c11\u306a\u304f\u3057\u3001\u5fc5\u8981\u306a\u5834\u5408\u306f\u6700\u3082\u52b9\u7387\u7684\u306a\u65b9\u6cd5\u3092\u9078\u3073\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30af\u30ea\u30c6\u30a3\u30ab\u30eb\u306a\u95a2\u6570\nfunction calculateSum(array $values): float {\n    $sum = 0;\n    \n    \/\/ \u578b\u5ba3\u8a00\u3067\u914d\u5217\u3067\u3042\u308b\u3053\u3068\u306f\u4fdd\u8a3c\u6e08\u307f\n    foreach ($values as $value) {\n        \/\/ is_numeric()\u306f\u6bd4\u8f03\u7684\u30b3\u30b9\u30c8\u304c\u9ad8\u3044\n        \/\/ $sum += is_numeric($value) ? (float)$value : 0; \/\/ \u60aa\u3044\u4f8b\n        \n        \/\/ \u6761\u4ef6\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u578b\u5909\u63db\u306e\u307f\u3092\u884c\u3046\n        $sum += (float)$value; \/\/ \u826f\u3044\u4f8b\n    }\n    \n    return $sum;\n}\n<\/pre>\n\n\n\n<p><strong>4. \u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3057\u3066\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af\u3092\u6e1b\u3089\u3059<\/strong><\/p>\n\n\n\n<p>PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u95a2\u6570\u5185\u3067\u306e\u660e\u793a\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u6e1b\u3089\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b: \u95a2\u6570\u5185\u3067\u578b\u30c1\u30a7\u30c3\u30af\nfunction addNumbers($a, $b) {\n    if (!is_numeric($a) || !is_numeric($b)) {\n        throw new InvalidArgumentException('Numbers expected');\n    }\n    \n    return $a + $b;\n}\n\n\/\/ \u826f\u3044\u4f8b: \u578b\u5ba3\u8a00\u3092\u4f7f\u7528\nfunction addNumbers(float $a, float $b): float {\n    \/\/ \u578b\u30c1\u30a7\u30c3\u30af\u306fPHP\u30a8\u30f3\u30b8\u30f3\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u884c\u308f\u308c\u308b\n    return $a + $b;\n}\n<\/pre>\n\n\n\n<p><strong>5. \u5927\u898f\u6a21\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306e\u578b\u78ba\u8a8d\u6226\u7565<\/strong><\/p>\n\n\n\n<p>\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u52b9\u679c\u7684\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5883\u754c\u3067\u306e\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af<\/strong>: \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5883\u754c\uff08\u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u3001\u30d5\u30a1\u30a4\u30eb\u5165\u529b\u306a\u3069\uff09\u3067\u306f\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/li>\n\n\n\n<li><strong>\u5185\u90e8\u51e6\u7406\u3067\u306f\u578b\u5ba3\u8a00\u306b\u4f9d\u5b58<\/strong>: \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5185\u90e8\u306e\u51e6\u7406\u3067\u306f\u3001\u578b\u5ba3\u8a00\u3092\u6d3b\u7528\u3057\u3066\u660e\u793a\u7684\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u308b<\/li>\n\n\n\n<li><strong>\u958b\u767a\u74b0\u5883\u3067\u306e\u307f\u8a73\u7d30\u306a\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/strong>: \u958b\u767a\u74b0\u5883\u3067\u306f\u8a73\u7d30\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3044\u3001\u672c\u756a\u74b0\u5883\u3067\u306f\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u30c1\u30a7\u30c3\u30af\u306b\u7559\u3081\u308b<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5883\u754c\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af\nfunction processUserInput(array $input): ProcessedData {\n    \/\/ \u5916\u90e8\u5165\u529b\u306e\u53b3\u683c\u306a\u691c\u8a3c\n    $validated = validateAndSanitize($input);\n    \n    \/\/ \u5185\u90e8\u51e6\u7406\u306f\u30af\u30e9\u30b9\u3068\u578b\u5ba3\u8a00\u306b\u4efb\u305b\u308b\n    return new ProcessedData($validated);\n}\n\n\/\/ \u578b\u5ba3\u8a00\u306b\u3088\u308b\u5185\u90e8\u51e6\u7406\nclass ProcessedData {\n    private string $name;\n    private int $age;\n    \n    public function __construct(array $data) {\n        $this-&gt;name = $data['name'];\n        $this-&gt;age = (int)$data['age'];\n    }\n    \n    public function getName(): string {\n        return $this-&gt;name;\n    }\n    \n    public function getAge(): int {\n        return $this-&gt;age;\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-134\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30b3\u30fc\u30c9\u54c1\u8cea\u306e\u30d0\u30e9\u30f3\u30b9<\/h4>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u54c1\u8cea\u306e\u30c8\u30ec\u30fc\u30c9\u30aa\u30d5\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u539f\u5247\u3092\u8003\u616e\u3057\u3066\u3001\u9069\u5207\u306a\u30d0\u30e9\u30f3\u30b9\u3092\u53d6\u308a\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30c7\u30fc\u30bf\u6574\u5408\u6027\u304c\u91cd\u8981\u306a\u90e8\u5206\u3067\u306f\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/strong><\/li>\n\n\n\n<li><strong>\u30db\u30c3\u30c8\u30d1\u30b9\u3084\u6027\u80fd\u30af\u30ea\u30c6\u30a3\u30ab\u30eb\u306a\u90e8\u5206\u3067\u306f\u578b\u30c1\u30a7\u30c3\u30af\u3092\u6700\u9069\u5316\u3059\u308b<\/strong><\/li>\n\n\n\n<li><strong>PHP 7\u4ee5\u964d\u306e\u578b\u5ba3\u8a00\u3092\u7a4d\u6975\u7684\u306b\u6d3b\u7528\u3057\u3066\u30e9\u30f3\u30bf\u30a4\u30e0\u3067\u306e\u578b\u30c1\u30a7\u30c3\u30af\u3092\u6e1b\u3089\u3059<\/strong><\/li>\n\n\n\n<li><strong>\u30c7\u30d0\u30c3\u30b0\u7528\u306e\u578b\u30c1\u30a7\u30c3\u30af\uff08<code>var_dump()<\/code>\u306a\u3069\uff09\u306f\u958b\u767a\u74b0\u5883\u3067\u306e\u307f\u4f7f\u7528\u3059\u308b<\/strong><\/li>\n\n\n\n<li><strong>\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\uff08PHPStan\u3001Psalm\u306a\u3069\uff09\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u578b\u306e\u554f\u984c\u3092\u691c\u51fa\u3059\u308b<\/strong><\/li>\n<\/ol>\n\n\n\n<p>\u9069\u5207\u306a\u578b\u78ba\u8a8d\u65b9\u6cd5\u3092\u9078\u3073\u3001\u5fc5\u8981\u306a\u5834\u6240\u3067\u5fc5\u8981\u306a\u91cf\u306e\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u640d\u306a\u3046\u3053\u3068\u306a\u304f\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u9069\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u578b\u5ba3\u8a00\u3068\u9759\u7684\u89e3\u6790\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u52b9\u679c\u7684\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-135\">\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h3>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u5358\u306a\u308b\u6280\u8853\u7684\u306a\u30a8\u30af\u30b5\u30b5\u30a4\u30ba\u3067\u306f\u306a\u304f\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u7fd2\u6163\u3067\u3059\u3002\u9069\u5207\u306a\u578b\u78ba\u8a8d\u7fd2\u6163\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u30d0\u30b0\u306e\u6e1b\u5c11\u3001\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u3084\u3059\u3055\u306e\u5411\u4e0a\u3001\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u306e\u6539\u5584\u3068\u3044\u3063\u305f\u591a\u304f\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\u3002\u3053\u306e\u7ae0\u3067\u306f\u3001\u65e5\u5e38\u7684\u306a\u958b\u767a\u4f5c\u696d\u306b\u7d44\u307f\u8fbc\u3080\u3079\u304d\u578b\u78ba\u8a8d\u7fd2\u6163\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-136\">\u500b\u4eba\u958b\u767a\u8005\u5411\u3051\u578b\u78ba\u8a8d\u7fd2\u6163<\/h4>\n\n\n\n<p>\u500b\u4eba\u3067\u958b\u767a\u3092\u884c\u3046\u5834\u5408\u3067\u3082\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u578b\u78ba\u8a8d\u7fd2\u6163\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5ba3\u8a00\u304b\u3089\u59cb\u3081\u308b<\/strong>: \u65b0\u3057\u3044\u95a2\u6570\u3084\u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304f\u969b\u306f\u3001\u307e\u305a\u5f15\u6570\u3068\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u5ba3\u8a00\u304b\u3089\u59cb\u3081\u308b\u826f\u3044\u7fd2\u6163\nfunction calculateTotal(array $items, float $taxRate): float {\n    \/\/ \u95a2\u6570\u306e\u5b9f\u88c5...\n}\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>\u53b3\u683c\u30e2\u30fc\u30c9\u3092\u6a19\u6e96\u306b\u3059\u308b<\/strong>: \u65b0\u3057\u3044PHP\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u5e38\u306b<code>declare(strict_types=1);<\/code>\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3092\u7fd2\u6163\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\ndeclare(strict_types=1);\n\n\/\/ \u4ee5\u964d\u306e\u30b3\u30fc\u30c9\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u5909\u6570\u306e\u521d\u671f\u5316\u6642\u306b\u578b\u3092\u610f\u8b58\u3059\u308b<\/strong>: \u5909\u6570\u3092\u521d\u671f\u5316\u3059\u308b\u969b\u306f\u3001\u610f\u56f3\u3057\u305f\u578b\u3067\u521d\u671f\u5316\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u578b\u3092\u610f\u8b58\u3057\u305f\u521d\u671f\u5316\n$count = 0;         \/\/ \u6574\u6570\u578b\u3068\u3057\u3066\u521d\u671f\u5316\n$names = [];        \/\/ \u914d\u5217\u3068\u3057\u3066\u521d\u671f\u5316\n$price = 0.0;       \/\/ \u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u3068\u3057\u3066\u521d\u671f\u5316\n$message = '';      \/\/ \u6587\u5b57\u5217\u3068\u3057\u3066\u521d\u671f\u5316\n$isActive = false;  \/\/ \u8ad6\u7406\u578b\u3068\u3057\u3066\u521d\u671f\u5316\n<\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>\u578b\u5909\u63db\u3092\u660e\u793a\u7684\u306b\u884c\u3046<\/strong>: \u578b\u5909\u63db\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f\u3001\u6697\u9ed9\u306e\u578b\u5909\u63db\u306b\u983c\u3089\u305a\u3001\u660e\u793a\u7684\u306b\u30ad\u30e3\u30b9\u30c8\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u660e\u793a\u7684\u306a\u578b\u5909\u63db\n$id = (int) $_GET['id'];              \/\/ \u6587\u5b57\u5217\u304b\u3089\u6574\u6570\u3078\n$amount = (float) $formData['amount']; \/\/ \u6587\u5b57\u5217\u304b\u3089\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u3078\n$isEnabled = (bool) $config['enabled']; \/\/ \u69d8\u3005\u306a\u5024\u304b\u3089\u8ad6\u7406\u5024\u3078\n<\/pre>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li><strong>\u5916\u90e8\u5165\u529b\u306b\u306f\u5e38\u306b\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/strong>: \u30e6\u30fc\u30b6\u30fc\u5165\u529b\u3001\u30d5\u30a1\u30a4\u30eb\u5165\u529b\u3001API\u30ec\u30b9\u30dd\u30f3\u30b9\u306a\u3069\u306e\u5916\u90e8\u30c7\u30fc\u30bf\u306b\u306f\u5fc5\u305a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u5916\u90e8\u5165\u529b\u306e\u578b\u30c1\u30a7\u30c3\u30af\nfunction processUserInput($data) {\n    if (!is_array($data)) {\n        throw new InvalidArgumentException('Array expected');\n    }\n    \n    if (!isset($data['email']) || !is_string($data['email'])) {\n        throw new InvalidArgumentException('Valid email required');\n    }\n    \n    if (!isset($data['age']) || !is_numeric($data['age']) || (int)$data['age'] &lt;= 0) {\n        throw new InvalidArgumentException('Valid age required');\n    }\n    \n    \/\/ \u51e6\u7406\u3092\u7d9a\u884c...\n}\n<\/pre>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li><strong>PHPDoc\u30b3\u30e1\u30f3\u30c8\u3092\u6d3b\u7528\u3059\u308b<\/strong>: \u7279\u306b\u8907\u96d1\u306a\u578b\u60c5\u5831\uff08\u914d\u5217\u306e\u5185\u90e8\u69cb\u9020\u306a\u3069\uff09\u306f\u3001PHPDoc\u30b3\u30e1\u30f3\u30c8\u3067\u8a73\u7d30\u306b\u8a18\u8ff0\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u95a2\u6570\n * \n * @param array $userData \u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u306e\u914d\u5217\n *                          ['name' =&gt; string, 'email' =&gt; string, 'age' =&gt; int]\n * @return array \u51e6\u7406\u7d50\u679c\u306e\u914d\u5217\n *               ['success' =&gt; bool, 'message' =&gt; string, 'user_id' =&gt; int]\n *\/\nfunction processUserData(array $userData): array {\n    \/\/ \u95a2\u6570\u306e\u5b9f\u88c5...\n}\n<\/pre>\n\n\n\n<ol start=\"7\" class=\"wp-block-list\">\n<li><strong>\u81ea\u52d5\u30c6\u30b9\u30c8\u3067\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3046<\/strong>: \u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8\u3067\u5024\u306e\u578b\u3082\u78ba\u8a8d\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public function testCalculateTotal(): void {\n    $result = calculateTotal([10, 20, 30], 0.1);\n    \n    $this-&gt;assertIsFloat($result);       \/\/ \u578b\u306e\u30c1\u30a7\u30c3\u30af\n    $this-&gt;assertEquals(66.0, $result);  \/\/ \u5024\u306e\u30c1\u30a7\u30c3\u30af\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-137\">\u30c1\u30fc\u30e0\u3067\u5171\u6709\u3059\u3079\u304d\u578b\u78ba\u8a8d\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h4>\n\n\n\n<p>\u30c1\u30fc\u30e0\u958b\u767a\u3067\u306f\u3001\u578b\u78ba\u8a8d\u306b\u95a2\u3059\u308b\u5171\u901a\u306e\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3068\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u3092\u6301\u3064\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u30c1\u30fc\u30e0\u5168\u4f53\u3067\u5171\u6709\u3059\u3079\u304d\u578b\u78ba\u8a8d\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u306e\u4f8b\u3067\u3059\uff1a<\/p>\n\n\n\n<p><strong>\u65b0\u898f\u30b3\u30fc\u30c9\u4f5c\u6210\u6642\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] \u3059\u3079\u3066\u306e\u95a2\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306b\u5f15\u6570\u306e\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u3059\u3079\u3066\u306e\u95a2\u6570\u3068\u30e1\u30bd\u30c3\u30c9\u306b\u623b\u308a\u5024\u306e\u578b\u5ba3\u8a00\u3092\u8ffd\u52a0\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u306b\u306f<code>declare(strict_types=1);<\/code>\u3092\u8a18\u8ff0\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u30af\u30e9\u30b9\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u578b\u5ba3\u8a00\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u304b\uff08PHP 7.4\u4ee5\u964d\uff09<\/li>\n\n\n\n<li>[ ] \u5916\u90e8\u30c7\u30fc\u30bf\u306b\u5bfe\u3057\u3066\u9069\u5207\u306a\u578b\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3063\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u578b\u5909\u63db\u306f\u660e\u793a\u7684\u306b\u884c\u3063\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u8907\u96d1\u306a\u578b\u60c5\u5831\u306fPHPDoc\u30b3\u30e1\u30f3\u30c8\u3067\u8a18\u8ff0\u3057\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff08\u914d\u5217\uff09\u306e\u8981\u7d20\u578b\u3092\u660e\u78ba\u306b\u3057\u3066\u3044\u308b\u304b<\/li>\n<\/ul>\n\n\n\n<p><strong>\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u6642\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] \u578b\u5ba3\u8a00\u3068\u5b9f\u969b\u306e\u4f7f\u7528\u65b9\u6cd5\u306b\u77db\u76fe\u304c\u306a\u3044\u304b<\/li>\n\n\n\n<li>[ ] \u6f5c\u5728\u7684\u306a\u578b\u5909\u63db\u306e\u554f\u984c\u304c\u306a\u3044\u304b<\/li>\n\n\n\n<li>[ ] nullable\u578b\uff08<code>?string<\/code>\u306a\u3069\uff09\u306e\u4f7f\u7528\u306f\u9069\u5207\u304b<\/li>\n\n\n\n<li>[ ] <code>mixed<\/code>\u578b\u306e\u4f7f\u7528\u306f\u6700\u5c0f\u9650\u306b\u6291\u3048\u3089\u308c\u3066\u3044\u308b\u304b<\/li>\n\n\n\n<li>[ ] instanceof\u6f14\u7b97\u5b50\u306e\u4f7f\u7528\u9806\u5e8f\u306f\u9069\u5207\u304b\uff08\u5b50\u30af\u30e9\u30b9\u304b\u3089\u5148\u306b\u30c1\u30a7\u30c3\u30af\uff09<\/li>\n\n\n\n<li>[ ] \u623b\u308a\u5024\u306e\u578b\u306f\u4e00\u8cab\u3057\u3066\u3044\u308b\u304b\uff08null\u3092\u8fd4\u3059\u53ef\u80fd\u6027\u304c\u3042\u308b\u5834\u5408\u306f<code>?<\/code>\u3092\u4f7f\u7528\uff09<\/li>\n\n\n\n<li>[ ] PHPDoc\u3068\u578b\u5ba3\u8a00\u306e\u60c5\u5831\u306f\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-138\">\u5b9f\u8df5\u7684\u306a\u578b\u78ba\u8a8d\u7fd2\u6163\u306e\u4f8b<\/h4>\n\n\n\n<p>\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306e\u578b\u78ba\u8a8d\u7fd2\u6163\u306e\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<p><strong>1. \u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u30af\u30e9\u30b9\u3067\u306e\u578b\u78ba\u8a8d<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\ndeclare(strict_types=1);\n\nclass UserRequest {\n    private array $data;\n    \n    public function __construct(array $requestData) {\n        $this-&gt;data = $requestData;\n    }\n    \n    public function validate(): bool {\n        return isset($this-&gt;data['name']) &amp;&amp; is_string($this-&gt;data['name']) &amp;&amp;\n               isset($this-&gt;data['email']) &amp;&amp; is_string($this-&gt;data['email']) &amp;&amp;\n               isset($this-&gt;data['age']) &amp;&amp; is_numeric($this-&gt;data['age']);\n    }\n    \n    public function getName(): string {\n        if (!isset($this-&gt;data['name']) || !is_string($this-&gt;data['name'])) {\n            throw new InvalidArgumentException('Invalid name');\n        }\n        return $this-&gt;data['name'];\n    }\n    \n    public function getEmail(): string {\n        if (!isset($this-&gt;data['email']) || !is_string($this-&gt;data['email'])) {\n            throw new InvalidArgumentException('Invalid email');\n        }\n        return $this-&gt;data['email'];\n    }\n    \n    public function getAge(): int {\n        if (!isset($this-&gt;data['age']) || !is_numeric($this-&gt;data['age'])) {\n            throw new InvalidArgumentException('Invalid age');\n        }\n        return (int)$this-&gt;data['age'];\n    }\n}\n<\/pre>\n\n\n\n<p><strong>2. \u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u3067\u306e\u578b\u5ba3\u8a00\u6d3b\u7528<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\ndeclare(strict_types=1);\n\nclass UserService {\n    private UserRepository $repository;\n    \n    public function __construct(UserRepository $repository) {\n        $this-&gt;repository = $repository;\n    }\n    \n    \/**\n     * \u30e6\u30fc\u30b6\u30fc\u3092\u767b\u9332\u3059\u308b\n     * \n     * @param string $name \u30e6\u30fc\u30b6\u30fc\u540d\n     * @param string $email \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\n     * @param int $age \u5e74\u9f62\n     * @return User \u4f5c\u6210\u3055\u308c\u305f\u30e6\u30fc\u30b6\u30fc\n     * @throws DuplicateEmailException \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u65e2\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u5834\u5408\n     *\/\n    public function registerUser(string $name, string $email, int $age): User {\n        if ($this-&gt;repository-&gt;emailExists($email)) {\n            throw new DuplicateEmailException('Email already exists');\n        }\n        \n        $user = new User($name, $email, $age);\n        $this-&gt;repository-&gt;save($user);\n        \n        return $user;\n    }\n    \n    \/**\n     * \u6307\u5b9a\u3055\u308c\u305f\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u691c\u7d22\u3059\u308b\n     * \n     * @param array $criteria \u691c\u7d22\u6761\u4ef6\n     * @return User[] \u30e6\u30fc\u30b6\u30fc\u306e\u914d\u5217\n     *\/\n    public function findUsers(array $criteria): array {\n        return $this-&gt;repository-&gt;findBy($criteria);\n    }\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-139\">PHPDoc\u3068\u306e\u9023\u643a\u306b\u3088\u308b\u578b\u60c5\u5831\u306e\u5f37\u5316<\/h4>\n\n\n\n<p>\u578b\u5ba3\u8a00\u3060\u3051\u3067\u306f\u8868\u73fe\u3067\u304d\u306a\u3044\u8907\u96d1\u306a\u578b\u60c5\u5831\uff08\u914d\u5217\u306e\u5185\u90e8\u69cb\u9020\u306a\u3069\uff09\u306f\u3001PHPDoc\u30b3\u30e1\u30f3\u30c8\u3092\u6d3b\u7528\u3057\u3066\u5f37\u5316\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/**\n * \u5546\u54c1\u30c7\u30fc\u30bf\u304b\u3089\u8acb\u6c42\u66f8\u3092\u751f\u6210\u3059\u308b\n * \n * @param array[] $items \u5546\u54c1\u30c7\u30fc\u30bf\u306e\u914d\u5217\n *                      \u5404\u8981\u7d20\u306f ['product_id' =&gt; int, 'quantity' =&gt; int, 'price' =&gt; float] \u306e\u5f62\u5f0f\n * @param array $customer \u9867\u5ba2\u60c5\u5831\n *                       ['name' =&gt; string, 'email' =&gt; string, 'address' =&gt; string]\n * @param float $taxRate \u7a0e\u7387 (0.0\u301c1.0\u306e\u7bc4\u56f2)\n * @return array{total: float, tax: float, items: array, customer: array} \u8acb\u6c42\u66f8\u30c7\u30fc\u30bf\n *\/\nfunction generateInvoice(array $items, array $customer, float $taxRate): array {\n    \/\/ \u5546\u54c1\u3054\u3068\u306e\u5c0f\u8a08\u3092\u8a08\u7b97\n    $subtotal = 0.0;\n    foreach ($items as $item) {\n        \/\/ \u578b\u30c1\u30a7\u30c3\u30af\n        if (!isset($item['price']) || !is_numeric($item['price'])) {\n            throw new InvalidArgumentException('Item price must be numeric');\n        }\n        if (!isset($item['quantity']) || !is_int($item['quantity'])) {\n            throw new InvalidArgumentException('Item quantity must be integer');\n        }\n        \n        $subtotal += $item['price'] * $item['quantity'];\n    }\n    \n    \/\/ \u7a0e\u984d\u8a08\u7b97\n    $tax = $subtotal * $taxRate;\n    \n    \/\/ \u5408\u8a08\u91d1\u984d\n    $total = $subtotal + $tax;\n    \n    return [\n        'total' =&gt; $total,\n        'tax' =&gt; $tax,\n        'items' =&gt; $items,\n        'customer' =&gt; $customer\n    ];\n}\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-140\">\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u306b\u3088\u308b\u578b\u30c1\u30a7\u30c3\u30af\u306e\u81ea\u52d5\u5316<\/h4>\n\n\n\n<p>\u578b\u95a2\u9023\u306e\u554f\u984c\u3092\u65e9\u671f\u306b\u767a\u898b\u3059\u308b\u305f\u3081\u306b\u3001\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>PHPStan<\/strong>: PHP\u30b3\u30fc\u30c9\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3067\u3001\u578b\u306e\u554f\u984c\u3092\u6bb5\u968e\u7684\u306b\u691c\u51fa\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># PHPStan\u306e\u8a2d\u7f6e\ncomposer require --dev phpstan\/phpstan\n\n# \u6700\u3082\u53b3\u683c\u306a\u30ec\u30d9\u30eb\u3067\u89e3\u6790\u3092\u5b9f\u884c\n.\/vendor\/bin\/phpstan analyse --level 8 src\n<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Psalm<\/strong>: \u3088\u308a\u53b3\u683c\u306a\u578b\u30c1\u30a7\u30c3\u30af\u304c\u53ef\u80fd\u306a\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Psalm\u306e\u8a2d\u7f6e\ncomposer require --dev vimeo\/psalm\n\n# Psalm\u306e\u521d\u671f\u5316\n.\/vendor\/bin\/psalm --init\n\n# \u89e3\u6790\u3092\u5b9f\u884c\n.\/vendor\/bin\/psalm\n<\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>PHP_CodeSniffer<\/strong>: \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u30c1\u30a7\u30c3\u30af\u30c4\u30fc\u30eb\u3067\u3001\u578b\u95a2\u9023\u306e\u30eb\u30fc\u30eb\u3082\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># PHP_CodeSniffer\u306e\u8a2d\u7f6e\ncomposer require --dev squizlabs\/php_codesniffer\n\n# \u89e3\u6790\u3092\u5b9f\u884c\n.\/vendor\/bin\/phpcs src\n<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c4\u30fc\u30eb\u3092CI\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306b\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u578b\u95a2\u9023\u306e\u554f\u984c\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-141\">\u578b\u78ba\u8a8d\u7fd2\u6163\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u5c0e\u5165\u30b9\u30c6\u30c3\u30d7<\/h4>\n\n\n\n<p>\u578b\u78ba\u8a8d\u7fd2\u6163\u3092\u8eab\u306b\u3064\u3051\u308b\u3053\u3068\u3067\u5f97\u3089\u308c\u308b\u30e1\u30ea\u30c3\u30c8\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d0\u30b0\u306e\u6e1b\u5c11<\/strong>: \u578b\u95a2\u9023\u306e\u30d0\u30b0\u3092\u65e9\u671f\u306b\u767a\u898b\u3067\u304d\u308b<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u3084\u3059\u3055\u5411\u4e0a<\/strong>: \u578b\u60c5\u5831\u304c\u3042\u308b\u3053\u3068\u3067\u30b3\u30fc\u30c9\u306e\u610f\u56f3\u304c\u660e\u78ba\u306b\u306a\u308b<\/li>\n\n\n\n<li><strong>IDE\u306e\u30b5\u30dd\u30fc\u30c8\u5f37\u5316<\/strong>: \u578b\u60c5\u5831\u306b\u57fa\u3065\u3044\u305f\u30b3\u30fc\u30c9\u88dc\u5b8c\u3084\u9759\u7684\u89e3\u6790\u304c\u52b9\u679c\u7684\u306b\u6a5f\u80fd\u3059\u308b<\/li>\n\n\n\n<li><strong>\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u306e\u5bb9\u6613\u3055<\/strong>: \u578b\u60c5\u5831\u304c\u3042\u308b\u3053\u3068\u3067\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u6642\u306e\u5f71\u97ff\u7bc4\u56f2\u304c\u660e\u78ba\u306b\u306a\u308b<\/li>\n\n\n\n<li><strong>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3068\u3057\u3066\u306e\u5f79\u5272<\/strong>: \u578b\u5ba3\u8a00\u81ea\u4f53\u304c\u30b3\u30fc\u30c9\u306e\u4ed5\u69d8\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b<\/li>\n<\/ol>\n\n\n\n<p>\u30c1\u30fc\u30e0\u306b\u578b\u78ba\u8a8d\u7fd2\u6163\u3092\u5c0e\u5165\u3059\u308b\u305f\u3081\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u578b\u78ba\u8a8d\u30dd\u30ea\u30b7\u30fc\u306e\u7b56\u5b9a<\/strong>: \u30c1\u30fc\u30e0\u5168\u4f53\u3067\u578b\u78ba\u8a8d\u306b\u95a2\u3059\u308b\u30eb\u30fc\u30eb\u3068\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u3092\u5b9a\u3081\u308b<\/li>\n\n\n\n<li><strong>\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u6bb5\u968e\u7684\u6539\u5584<\/strong>: \u65b0\u898f\u30b3\u30fc\u30c9\u304b\u3089\u59cb\u3081\u3066\u3001\u91cd\u8981\u306a\u65e2\u5b58\u30b3\u30fc\u30c9\u306b\u3082\u5f90\u3005\u306b\u578b\u60c5\u5831\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n\n\n\n<li><strong>\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u306e\u5c0e\u5165<\/strong>: PHPStan\u3084Psalm\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u5c0e\u5165\u3057\u3001\u578b\u306e\u554f\u984c\u3092\u81ea\u52d5\u691c\u51fa\u3059\u308b<\/li>\n\n\n\n<li><strong>\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u3067\u306e\u78ba\u8a8d<\/strong>: \u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u3067\u578b\u60c5\u5831\u306e\u9069\u5207\u3055\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b<\/li>\n\n\n\n<li><strong>\u7d99\u7d9a\u7684\u306a\u5b66\u7fd2\u3068\u6539\u5584<\/strong>: PHP\u8a00\u8a9e\u306e\u578b\u30b7\u30b9\u30c6\u30e0\u306e\u9032\u5316\u306b\u5408\u308f\u305b\u3066\u3001\u578b\u78ba\u8a8d\u7fd2\u6163\u3082\u66f4\u65b0\u3057\u3066\u3044\u304f<\/li>\n<\/ol>\n\n\n\n<p>\u578b\u78ba\u8a8d\u306f\u4e00\u5ea6\u306e\u5927\u304d\u306a\u5909\u66f4\u3067\u306f\u306a\u304f\u3001\u65e5\u3005\u306e\u5c0f\u3055\u306a\u7fd2\u6163\u306e\u7a4d\u307f\u91cd\u306d\u306b\u3088\u3063\u3066\u3001\u30b3\u30fc\u30c9\u54c1\u8cea\u3092\u7d99\u7d9a\u7684\u306b\u5411\u4e0a\u3055\u305b\u308b\u3082\u306e\u3067\u3059\u3002\u578b\u3092\u610f\u8b58\u3057\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u7fd2\u6163\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5b89\u5168\u3067\u4fdd\u5b88\u6027\u306e\u9ad8\u3044PHP\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,63],"tags":[],"class_list":{"0":"post-3772","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"category-php-syntax","8":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3772"}],"version-history":[{"count":1,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3772\/revisions"}],"predecessor-version":[{"id":3773,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3772\/revisions\/3773"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}