﻿{"id":37294,"date":"2025-08-07T12:35:41","date_gmt":"2025-08-07T03:35:41","guid":{"rendered":"https:\/\/www.hcz.jp\/blog\/?p=37294"},"modified":"2025-08-18T18:14:56","modified_gmt":"2025-08-18T09:14:56","slug":"php-compatibility-checker-2022%e5%b9%b4%e3%81%ab%e3%82%b5%e3%83%9d%e3%83%bc%e3%83%88%e4%bf%ae%e4%ba%86%e3%80%82%e4%bb%a3%e6%9b%bf%e3%81%88%e3%81%af%e8%87%aa%e4%bd%9c%e3%83%97%e3%83%a9%e3%82%b0","status":"publish","type":"post","link":"https:\/\/www.hcz.jp\/blog\/?p=37294","title":{"rendered":"PHP Compatibility Checker 2022\u5e74\u306b\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3002\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30d7\u30e9\u30b0\u30a4\u30f3\uff1f"},"content":{"rendered":"<p><strong><span style=\"font-size: 16px;\">PHP Compatibility Checker \u30ef\u30fc\u30c9\u30d7\u30ec\u30b9 \u30d7\u30e9\u30b0\u30a4\u30f3<\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\">2022\u5e74\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3000\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30b9\u30af\u30ea\u30d7\u30c8<\/span><\/strong><\/p>\n<p><a href=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807.png\" data-rel=\"lightbox-image-0\" data-magnific_type=\"image\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-37298\" src=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-400x241.png\" alt=\"2025 0807 400x241 PHP Compatibility Checker 2022\u5e74\u306b\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3002\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30d7\u30e9\u30b0\u30a4\u30f3\uff1f\" width=\"400\" height=\"241\" srcset=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-400x241.png 400w, https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-300x181.png 300w, https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-150x90.png 150w, https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807.png 768w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" title=\"PHP Compatibility Checker 2022\u5e74\u306b\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3002\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30d7\u30e9\u30b0\u30a4\u30f3\uff1f\" \/><\/a><\/p>\n<p>\u5f53\u30d6\u30ed\u30b0\u3092php8\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u524d\u306b\u3001\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306b\u5c0e\u5165\u3057\u3066\u307f\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u3002<\/p>\n<p>\u826f\u304b\u308c\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u305f\u306e\u3060\u304c\u30fb\u30fb\u30fb<\/p>\n<p><a href=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-1.png\" data-rel=\"lightbox-image-1\" data-magnific_type=\"image\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-37299\" src=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-1.png\" alt=\"2025 0807 1 PHP Compatibility Checker 2022\u5e74\u306b\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3002\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30d7\u30e9\u30b0\u30a4\u30f3\uff1f\" width=\"342\" height=\"188\" srcset=\"https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-1.png 342w, https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-1-300x165.png 300w, https:\/\/www.hcz.jp\/blog\/wp-content\/uploads\/2025\/08\/2025-0807-1-150x82.png 150w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" title=\"PHP Compatibility Checker 2022\u5e74\u306b\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3002\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30d7\u30e9\u30b0\u30a4\u30f3\uff1f\" \/><\/a><\/p>\n<p>API \u3084\u5916\u90e8\u30b5\u30fc\u30d3\u30b9\u306b\u5bfe\u3057\u3066\u300c\u76e3\u67fb\uff08audit\uff09\u300d\u95a2\u9023\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3066\u3044\u308b\u304c\u3001version \u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3002WordPress \u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u5185\u3067 \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u756a\u53f7\u3092\u6307\u5b9a\u3059\u308b\u9805\u76ee\u304c\u7a7a\u6b04\u306e\u307e\u307e\u3002\u81ea\u4f5c\u30b3\u30fc\u30c9\u3084\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u3067\u300cversion\u300d\u3092\u9001\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30c6\u30fc\u30de\u306e\u30a8\u30e9\u30fc\u304c\u691c\u51fa\u3055\u308c\u305f\u306e\u3067\u6df1\u5800\u3057\u3066\u307f\u305f\u3002<\/p>\n<p>\u3063\u3066\u304b\u3001\u30e0\u30ba\u305d\u3046\u3060\u3063\u305f\u306e\u3067\u30c1\u30e3\u30c3\u30d4\u30fc\uff08ChatGPT\uff09\u306b\u554f\u3044\u304b\u3051\u3066\u307f\u305f\u3002<\/p>\n<p>\u56de\u7b54\u306f\u3053\u3046\u3060\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306f WP Engine \u306e\u5916\u90e8API\u306b\u30b5\u30a4\u30c8\u60c5\u5831\u3092\u9001\u3063\u3066\u30b9\u30ad\u30e3\u30f3\u3059\u308b\u4ed5\u7d44\u307f\u306a\u306e\u3067\u3059\u304c\u30012021\u5e74\u9803\u304b\u3089 API\u306e\u63d0\u4f9b\u304c\u7d42\u4e86\u3057\u3066\u3044\u3066\u3001\u73fe\u5728\u306f\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u300caudit project version\u300d\u3068\u3044\u3046\u5fc5\u9808\u30d1\u30e9\u30e1\u30fc\u30bf\u3092 API \u5074\u304c\u8981\u6c42\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u3057\u304b\u3057\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u53e4\u3044\u307e\u307e\u3067\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3002<br \/>\n\u2192 400\u30a8\u30e9\u30fc\u3067\u52d5\u304b\u306a\u3044\u3000\u3068\u3044\u3046\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6b8b\u5ff5\u306a\u304c\u3089 \u516c\u5f0f\u306e PHP Compatibility Checker \u306f\u3082\u3046\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u4ee3\u66ff\u624b\u6bb5\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\n<strong><span style=\"font-size: 16px;\">1. \u4ee3\u66ff\u30d7\u30e9\u30b0\u30a4\u30f3<\/span><br \/>\n<\/strong>Code Profiler\uff08\u4e92\u63db\u6027\u30c6\u30b9\u30c8\u542b\u3080\uff09<br \/>\nQuery Monitor\uff08\u9593\u63a5\u7684\u306bPHP\u30a8\u30e9\u30fc\u78ba\u8a8d\uff09<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 16px;\">2. \u624b\u52d5\u3067\u30c1\u30a7\u30c3\u30af\u3059\u308b\u65b9\u6cd5<\/span><br \/>\n<\/strong>WordPress\u516c\u5f0f\u306e \u5bfe\u5fdcPHP\u30d0\u30fc\u30b8\u30e7\u30f3\u8868 \u3092\u53c2\u7167\u3057\u3064\u3064\u3001\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u304c PHP 8.1\/8.2\/8.3 \u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<br \/>\n\u30c6\u30b9\u30c8\u74b0\u5883\u3067\u5b9f\u969b\u306b\u65b0\u3057\u3044 PHP \u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u308a\u66ff\u3048\u3066\u78ba\u8a8d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-size: 16px;\">3. Composer\u4e0d\u8981\u306e\u7c21\u6613\u30c1\u30a7\u30c3\u30af<\/span><br \/>\n<\/strong>WordPress\u74b0\u5883\u306b\u8a2d\u7f6e\u3057\u3066PHP\u4e92\u63db\u6027\u3092\u7c21\u6613\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002<br \/>\n\u203b \u81ea\u4f5c\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u3001\u305d\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u30a8\u30e9\u30fc\u3092\u691c\u51fa\u3059\u308b\u65b9\u6cd5\u306d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3058\u3083\u81ea\u4f5c\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u304b\u306d\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u30fc\u306e WordPress \u30eb\u30fc\u30c8\u30d5\u30a9\u30eb\u30c0\uff08wp-config.php \u304c\u3042\u308b\u5834\u6240\uff09\u306b<br \/>\n<span style=\"background-color: #99ccff;\"><strong>php-compat-checker.php<\/strong><\/span> \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3002<br \/>\n\u5f8c\u306f\u30d6\u30e9\u30a6\u30b6\u3067<br \/>\nhttps:\/\/\u3042\u306a\u305f\u306e\u30b5\u30a4\u30c8\/php-compat-checker.php<br \/>\n\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3060\u3051\u3067\u3001\u30b5\u30a4\u30c8\u306ePHP\u30d0\u30fc\u30b8\u30e7\u30f3\/\u975e\u63a8\u5968\u95a2\u6570\u306e\u691c\u51fa\u7d50\u679c<br \/>\n\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>php-compat-checker.php<\/strong>\u306e\u4e2d\u8eab\u306e\u30b3\u30fc\u30c9\u306f\u4e0b\u8a18\u53c2\u7167\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;?php\r\n\/**\r\n* Simple PHP Compatibility Checker (standalone)\r\n* Composer\u4e0d\u8981 \/ \u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u4f7f\u7528\r\n*\r\n* \u6ce8\u610f:\r\n* - \u3042\u304f\u307e\u3067\u7c21\u6613\u30c1\u30a7\u30c3\u30af\u3067\u3059\r\n* - \u6b63\u5f0f\u306a PHPCompatibility (PHP CodeSniffer) \u307b\u3069\u6b63\u78ba\u3067\u306f\u3042\u308a\u307e\u305b\u3093\r\n* - \u30c6\u30b9\u30c8\u7528\u30b5\u30fc\u30d0\u30fc\u3067\u306e\u5229\u7528\u63a8\u5968\r\n*\/\r\n\r\n$directory = __DIR__; \/\/ WordPress\u306e\u30eb\u30fc\u30c8\u304b\u3089\u30c1\u30a7\u30c3\u30af\r\n$phpVersion = phpversion();\r\necho \"&lt;h1&gt;PHP Compatibility Checker&lt;\/h1&gt;\";\r\necho \"&lt;p&gt;\u73fe\u5728\u306ePHP\u30d0\u30fc\u30b8\u30e7\u30f3: &lt;strong&gt;{$phpVersion}&lt;\/strong&gt;&lt;\/p&gt;\";\r\necho \"&lt;p&gt;\u30c1\u30a7\u30c3\u30af\u5bfe\u8c61\u30c7\u30a3\u30ec\u30af\u30c8\u30ea: {$directory}&lt;\/p&gt;&lt;hr&gt;\";\r\n\r\n$iterator = new RecursiveIteratorIterator(\r\nnew RecursiveDirectoryIterator($directory)\r\n);\r\n\r\n$issues = [];\r\nforeach ($iterator as $file) {\r\nif ($file-&gt;isFile() &amp;&amp; preg_match('\/\\.(php|inc)$\/i', $file-&gt;getFilename())) {\r\n$content = file_get_contents($file-&gt;getPathname());\r\n\r\n\/\/ \u7c21\u6613\u691c\u51fa\u30eb\u30fc\u30eb\r\n$patterns = [\r\n'mysql_' =&gt; '\u53e4\u3044mysql_*\u95a2\u6570 (PHP7.0\u4ee5\u964d\u524a\u9664)',\r\n'create_function' =&gt; 'create_function() (PHP7.2\u4ee5\u964d\u975e\u63a8\u5968)',\r\n'each\\(' =&gt; 'each() (PHP7.2\u4ee5\u964d\u524a\u9664)',\r\n'ereg' =&gt; 'ereg\u7cfb\u95a2\u6570 (PHP7.0\u4ee5\u964d\u524a\u9664)',\r\n'split\\(' =&gt; 'split() (PHP7.0\u4ee5\u964d\u524a\u9664)',\r\n'magic_quotes' =&gt; 'Magic Quotes\u95a2\u9023 (PHP5.4\u4ee5\u964d\u524a\u9664)',\r\n];\r\n\r\nforeach ($patterns as $pattern =&gt; $desc) {\r\nif (preg_match(\"\/{$pattern}\/i\", $content)) {\r\n$issues[] = [\r\n'file' =&gt; $file-&gt;getPathname(),\r\n'issue' =&gt; $desc\r\n];\r\n}\r\n}\r\n}\r\n}\r\n\r\n\/\/ \u7d50\u679c\u8868\u793a\r\nif (empty($issues)) {\r\necho \"&lt;p style='color:green'&gt;&lt;strong&gt;\u554f\u984c\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\uff01&lt;\/strong&gt;&lt;\/p&gt;\";\r\n} else {\r\necho \"&lt;h2&gt;\u691c\u51fa\u3055\u308c\u305f\u4e92\u63db\u6027\u306e\u554f\u984c&lt;\/h2&gt;\";\r\necho \"&lt;ul&gt;\";\r\nforeach ($issues as $issue) {\r\necho \"&lt;li&gt;&lt;code&gt;{$issue['file']}&lt;\/code&gt; \u2192 {$issue['issue']}&lt;\/li&gt;\";\r\n}\r\necho \"&lt;\/ul&gt;\";\r\n}\r\n\r\necho \"&lt;hr&gt;&lt;p&gt;\u203b \u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u7c21\u6613\u30c1\u30a7\u30c3\u30af\u3067\u3059\u3002&lt;\/p&gt;\";<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #800000;\"><strong>\uff08\u6ce8\u610f\uff09\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u4e0a\u3001\u30c1\u30a7\u30c3\u30af\u304c\u7d42\u308f\u3063\u305f\u3089\u5fc5\u305a\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/span><\/p>\n<p>\u4ee5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP Compatibility Checker \u30ef\u30fc\u30c9\u30d7\u30ec\u30b9 \u30d7\u30e9\u30b0\u30a4\u30f3 2022\u5e74\u30b5\u30dd\u30fc\u30c8\u4fee\u4e86\u3000\u4ee3\u66ff\u3048\u306f\u81ea\u4f5c\u30b9\u30af\u30ea\u30d7\u30c8 \u5f53\u30d6\u30ed\u30b0\u3092php8\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3059\u308b\u524d\u306b\u3001\u30a8\u30e9\u30fc\u30c1\u30a7\u30c3\u30af\u306b\u5c0e\u5165\u3057\u3066\u307f\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u3002 \u826f\u304b\u308c\u2026<\/p>\n","protected":false},"author":1,"featured_media":37298,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,213],"tags":[516,520],"class_list":["post-37294","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-seo","tag-516","tag-520"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=37294"}],"version-history":[{"count":12,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37294\/revisions"}],"predecessor-version":[{"id":37311,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/37294\/revisions\/37311"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=\/wp\/v2\/media\/37298"}],"wp:attachment":[{"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=37294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=37294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hcz.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=37294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}