{"id":824,"date":"2025-08-04T18:11:56","date_gmt":"2025-08-04T09:11:56","guid":{"rendered":"https:\/\/nexive.tech\/?p=824"},"modified":"2025-08-04T18:11:57","modified_gmt":"2025-08-04T09:11:57","slug":"%e3%80%90%e3%82%b5%e3%82%af%e3%83%83%e3%81%a8%e8%a7%a3%e8%aa%ac%e3%80%91php-%e3%83%87%e3%83%90%e3%83%83%e3%82%b0%e9%96%a2%e6%95%b0%e3%81%ae%e4%bd%bf%e3%81%84%e5%88%86%e3%81%91","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=824","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011PHP \u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u306e\u4f7f\u3044\u5206\u3051"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP\u306e\u4ee3\u8868\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u7528\u95a2\u6570\uff08var_dump \/ print_r \/ debug_backtrace\uff09\u306e\u9055\u3044\u3068\u4f7f\u3044\u5206\u3051\u3092\u89e3\u8aac<\/li>\n\n\n\n<li>\u5404\u95a2\u6570\u306e\u51fa\u529b\u5f62\u5f0f\u3084\u6d3b\u7528\u5834\u9762\u3092\u3001\u5b9f\u884c\u53ef\u80fd\u306a\u30b3\u30fc\u30c9\u4ed8\u304d\u3067\u7d39\u4ecb<\/li>\n\n\n\n<li>\u8aa4\u7528\u306b\u3088\u308b\u51fa\u529b\u306e\u8aa4\u8a8d\u3084\u3001\u5b9f\u52d9\u3067\u3042\u308a\u304c\u3061\u306a\u843d\u3068\u3057\u7a74\u306b\u3082\u6ce8\u610f\u559a\u8d77<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. PHP\u306e\u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>PHP\u306b\u306f\u3001\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u72b6\u6cc1\u3084\u5909\u6570\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u300c\u30c7\u30d0\u30c3\u30b0\u7528\u95a2\u6570\u300d\u304c\u6a19\u6e96\u3067\u3044\u304f\u3064\u304b\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306b\u4ee3\u8868\u7684\u306a\u306e\u304c <code>var_dump()<\/code>\u3001<code>print_r()<\/code>\u3001<code>debug_backtrace()<\/code> \u306e3\u3064\u3067\u3001\u3044\u305a\u308c\u3082Xdebug\u306a\u3069\u306e\u5916\u90e8\u30c4\u30fc\u30eb\u3092\u4f7f\u308f\u305a\u306b\u3001PHP\u3060\u3051\u3067\u5b9f\u884c\u5185\u5bb9\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306f\u4e3b\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u76ee\u7684\u3067\u4f7f\u308f\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5909\u6570\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u304d\uff08\u69cb\u9020\u3084\u578b\u3082\u542b\u3081\u3066\uff09<\/li>\n\n\n\n<li>\u5b9f\u884c\u30d5\u30ed\u30fc\u306e\u8ffd\u8de1\u3084\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u5c65\u6b74\u3092\u8abf\u3079\u305f\u3044\u3068\u304d<\/li>\n\n\n\n<li>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3084\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8\u6642\u306b\u3001\u5185\u90e8\u72b6\u614b\u3092\u4e00\u6642\u7684\u306b\u51fa\u529b\u3057\u305f\u3044\u3068\u304d<\/li>\n<\/ul>\n\n\n\n<p>\u305f\u3060\u3057\u3001\u3053\u308c\u3089\u306e\u95a2\u6570\u306f\u300c\u672c\u756a\u74b0\u5883\u3067\u306f\u4f7f\u308f\u306a\u3044\u300d\u304c\u539f\u5247\u3067\u3059\u3002\u30ed\u30b0\u306b\u6b8b\u3063\u305f\u308a\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u306e\u60c5\u5831\u304c\u9732\u51fa\u3057\u305f\u308a\u3059\u308b\u305f\u3081\u3001\u958b\u767a\u74b0\u5883\u3067\u306e\u4e00\u6642\u7684\u306a\u5229\u7528\u306b\u3068\u3069\u3081\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8a73\u7d30\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">var_dump\uff1a\u8a73\u7d30\u306a\u578b\u30fb\u9577\u3055\u4ed8\u304d\u306e\u51fa\u529b\u304c\u6b32\u3057\u3044\u3068\u304d<\/h3>\n\n\n\n<p><code>var_dump(mixed $value): void<\/code> \u306f\u3001\u5909\u6570\u306e\u4e2d\u8eab\u30fb\u578b\u30fb\u30b5\u30a4\u30ba\u307e\u3067\u542b\u3081\u3066\u8a73\u7d30\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ \u914d\u5217\u306e\u69cb\u9020\u3068\u578b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u304d\n$data = &#91;\"id\" => 1, \"name\" => \"Alice\", \"is_active\" => true&#93;;\nvar_dump($data);\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u914d\u5217\u306e\u69cb\u9020\u3068\u578b\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u304d<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$data<\/span><span style=\"color: #D4D4D4\"> = &#91;<\/span><span style=\"color: #CE9178\">&quot;id&quot;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;name&quot;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&quot;Alice&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;is_active&quot;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #569CD6\">true<\/span><span style=\"color: #D4D4D4\">&#93;;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">var_dump<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$data<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>\u51fa\u529b\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>array(3) {\n  &#91;\"id\"&#93;=>\n  int(1)\n  &#91;\"name\"&#93;=>\n  string(5) \"Alice\"\n  &#91;\"is_active\"&#93;=>\n  bool(true)\n}\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #DCDCAA\">array<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">3<\/span><span style=\"color: #D4D4D4\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;<\/span><span style=\"color: #CE9178\">&quot;id&quot;<\/span><span style=\"color: #D4D4D4\">&#93;=&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">int<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;<\/span><span style=\"color: #CE9178\">&quot;name&quot;<\/span><span style=\"color: #D4D4D4\">&#93;=&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">string<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">5<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #CE9178\">&quot;Alice&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  &#91;<\/span><span style=\"color: #CE9178\">&quot;is_active&quot;<\/span><span style=\"color: #D4D4D4\">&#93;=&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #569CD6\">bool<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">true<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u69cb\u9020\u306e\u30cd\u30b9\u30c8\u304c\u6df1\u304f\u3066\u3082\u3001\u660e\u793a\u7684\u306b\u3059\u3079\u3066\u306e\u578b\u304c\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u89e3\u6790\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">print_r\uff1a\u3056\u3063\u304f\u308a\u4e2d\u8eab\u3092\u898b\u305f\u3044\u3068\u304d\u306b\u4fbf\u5229<\/h3>\n\n\n\n<p><code>print_r(mixed $value, bool $return = false): string|bool<\/code> \u306f\u3001\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u3092\u4eba\u9593\u306b\u3068\u3063\u3066\u8aad\u307f\u3084\u3059\u3044\u5f62\u3067\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ \u5909\u6570\u306e\u4e2d\u8eab\u3092\u8efd\u304f\u898b\u305f\u3044\u3068\u304d\n$user = &#91;\"id\" => 2, \"name\" => \"Bob\"&#93;;\nprint_r($user);\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u5909\u6570\u306e\u4e2d\u8eab\u3092\u8efd\u304f\u898b\u305f\u3044\u3068\u304d<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">$user<\/span><span style=\"color: #D4D4D4\"> = &#91;<\/span><span style=\"color: #CE9178\">&quot;id&quot;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;name&quot;<\/span><span style=\"color: #D4D4D4\"> =&gt; <\/span><span style=\"color: #CE9178\">&quot;Bob&quot;<\/span><span style=\"color: #D4D4D4\">&#93;;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">print_r<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">$user<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>\u51fa\u529b\u4f8b\uff1a<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Array\n(\n    &#91;id&#93; => 2\n    &#91;name&#93; => Bob\n)\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">Array<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    &#91;id&#93; =&gt; <\/span><span style=\"color: #B5CEA8\">2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    &#91;name&#93; =&gt; Bob<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>var_dump<\/code>\u3068\u6bd4\u3079\u3066\u578b\u60c5\u5831\u306f\u7701\u7565\u3055\u308c\u307e\u3059\u304c\u3001\u51fa\u529b\u304c\u898b\u3084\u3059\u304f\u3001\u78ba\u8a8d\u30b9\u30d4\u30fc\u30c9\u91cd\u8996\u306e\u5834\u9762\u3067\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">debug_backtrace\uff1a\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\u5c65\u6b74\u3092\u78ba\u8a8d\u3057\u305f\u3044\u3068\u304d<\/h3>\n\n\n\n<p><code>debug_backtrace<\/code> \u306f\u3001\u5b9f\u884c\u4e2d\u306e\u95a2\u6570\u547c\u3073\u51fa\u3057\u306e\u5c65\u6b74\u3092\u914d\u5217\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>function third() {\n    print_r(debug_backtrace());\n}\nfunction second() {\n    third();\n}\nfunction first() {\n    second();\n}\nfirst();\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">third<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">print_r<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #DCDCAA\">debug_backtrace<\/span><span style=\"color: #D4D4D4\">());<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">second<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">third<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">first<\/span><span style=\"color: #D4D4D4\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #DCDCAA\">second<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #DCDCAA\">first<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><strong>\u51fa\u529b\u4f8b\uff08\u629c\u7c8b\uff09\uff1a<\/strong><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">PHP<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Array\n(\n    &#91;0&#93; => Array\n        (\n            &#91;file&#93; => \/path\/to\/file.php\n            &#91;line&#93; => 3\n            &#91;function&#93; => third\n            &#91;args&#93; => Array()\n        )\n    &#91;1&#93; => Array\n        (\n            &#91;file&#93; => \/path\/to\/file.php\n            &#91;line&#93; => 7\n            &#91;function&#93; => second\n        )\n    ...\n)\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">Array<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    &#91;<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">&#93; =&gt; <\/span><span style=\"color: #569CD6\">Array<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;file&#93; =&gt; \/path\/to\/file<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;line&#93; =&gt; <\/span><span style=\"color: #B5CEA8\">3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;<\/span><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\">&#93; =&gt; third<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;args&#93; =&gt; <\/span><span style=\"color: #569CD6\">Array<\/span><span style=\"color: #D4D4D4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        )<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    &#91;<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&#93; =&gt; <\/span><span style=\"color: #569CD6\">Array<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;file&#93; =&gt; \/path\/to\/file<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #D4D4D4\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;line&#93; =&gt; <\/span><span style=\"color: #B5CEA8\">7<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">            &#91;<\/span><span style=\"color: #569CD6\">function<\/span><span style=\"color: #D4D4D4\">&#93; =&gt; second<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        )<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    ...<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u30ed\u30b0\u306e\u3088\u3046\u306b\u30d5\u30ed\u30fc\u3092\u9061\u308c\u308b\u305f\u3081\u3001\u4e88\u671f\u305b\u306c\u547c\u3073\u51fa\u3057\u3084\u591a\u91cd\u547c\u3073\u51fa\u3057\u306e\u691c\u8a3c\u306b\u6709\u52b9\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3088\u304f\u3042\u308b\u30df\u30b9\u30fb\u8aa4\u89e3\u30fb\u843d\u3068\u3057\u7a74<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>print_r()<\/code> \u306f\u30b9\u30ab\u30e9\u30fc\u5024\u306b\u5bfe\u3057\u3066\u4f7f\u3063\u3066\u3082\u610f\u5473\u304c\u8584\u304f\u3001\u5358\u306a\u308b\u6587\u5b57\u5217\u51fa\u529b\u306b\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>var_dump()<\/code> \u306e\u51fa\u529b\u306f\u305d\u306e\u307e\u307e\u3067\u306f\u898b\u3065\u3089\u304f\u3001HTML\u3067\u306f <code>&lt;pre&gt;<\/code> \u30bf\u30b0\u3067\u56f2\u3080\u306a\u3069\u306e\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>debug_backtrace()<\/code> \u306f\u8fd4\u308a\u5024\u304c\u914d\u5217\u3067\u3042\u308a\u3001\u76f4\u63a5 <code>echo<\/code> \u3057\u3066\u3082\u610f\u5473\u306e\u3042\u308b\u51fa\u529b\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002<code>print_r<\/code>\u3084<code>var_dump<\/code>\u3067\u51fa\u529b\u3059\u3079\u304d\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>var_export()<\/code> \u3068 <code>print_r()<\/code> \u3092\u6df7\u540c\u3059\u308b\u30b1\u30fc\u30b9\u3082\u3042\u308a\u307e\u3059\u304c\u3001<code>var_export()<\/code> \u306f\u69cb\u6587\u7684\u306b\u6709\u52b9\u306aPHP\u30b3\u30fc\u30c9\u3092\u8fd4\u3059\u70b9\u3067\u7570\u306a\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>Xdebug\u3068\u4f75\u7528\u3059\u308b\u5834\u5408\u3001\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u306f <code>var_dump<\/code> \u306e\u51fa\u529b\u304c\u6574\u5f62\u3055\u308c\u308b\u305f\u3081\u3001\u51fa\u529b\u306e\u5f62\u5f0f\u5dee\u7570\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>PHP\u306e\u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u306f\u3001\u5834\u9762\u306b\u5fdc\u3058\u305f\u4f7f\u3044\u5206\u3051\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8a73\u7d30\u78ba\u8a8d\u306b\u306f <code>var_dump()<\/code><\/li>\n\n\n\n<li>\u7c21\u6613\u30c1\u30a7\u30c3\u30af\u306b\u306f <code>print_r()<\/code><\/li>\n\n\n\n<li>\u547c\u3073\u51fa\u3057\u5c65\u6b74\u306e\u8ffd\u8de1\u306b\u306f <code>debug_backtrace()<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u3044\u305a\u308c\u3082\u300c\u4f55\u3092\u77e5\u308a\u305f\u3044\u304b\u300d\u3092\u660e\u78ba\u306b\u3057\u3066\u4f7f\u3044\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u7121\u99c4\u306a\u51fa\u529b\u3084\u8aa4\u89e3\u3092\u9632\u304e\u3001\u52b9\u7387\u7684\u306a\u30c7\u30d0\u30c3\u30b0\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u958b\u767a\u74b0\u5883\u4ee5\u5916\u3067\u306f\u4f7f\u7528\u3092\u907f\u3051\u308b\u3079\u304d\u3067\u3042\u308a\u3001\u4f7f\u7528\u5f8c\u306e\u524a\u9664\u30fb\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5fd8\u308c\u306a\u3044\u904b\u7528\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. PHP\u306e\u30c7\u30d0\u30c3\u30b0\u95a2\u6570\u3068\u306f\uff1f PHP\u306b\u306f\u3001\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u72b6\u6cc1\u3084\u5909\u6570\u306e\u4e2d\u8eab\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306e\u300c\u30c7\u30d0\u30c3\u30b0\u7528\u95a2\u6570\u300d\u304c\u6a19\u6e96\u3067\u3044\u304f\u3064\u304b\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u7279\u306b\u4ee3\u8868\u7684\u306a\u306e\u304c var_dump()\u3001print_ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":901,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[85],"tags":[],"class_list":["post-824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=824"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/824\/revisions"}],"predecessor-version":[{"id":902,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/824\/revisions\/902"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/901"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}