{"id":12061,"date":"2026-08-04T10:57:03","date_gmt":"2026-08-04T01:57:03","guid":{"rendered":"https:\/\/kusanagi.tokyo\/column?p=12061"},"modified":"2026-08-04T10:57:04","modified_gmt":"2026-08-04T01:57:04","slug":"php%e3%81%ae%e6%9c%80%e6%96%b0%e7%8a%b6%e6%b3%81%ef%bc%9a-php-8-6-%e3%81%a7%e9%96%a2%e6%95%b0%e3%81%ae%e9%83%a8%e5%88%86%e9%81%a9%e7%94%a8%e3%81%8c%e5%b0%8e%e5%85%a5%e3%81%95%e3%82%8c","status":"publish","type":"post","link":"https:\/\/kusanagi.tokyo\/column\/archives\/column_12061","title":{"rendered":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1a\u00a0PHP\u00a08.6\u00a0\u3067\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u304c\u5c0e\u5165\u3055\u308c\u308b\u00a0\uff08\u7b2c47\u56de\uff09"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u672c\u9023\u8f09\u306b\u304a\u3044\u3066\u306f\uff0cPHP\u754c\u9688\u306e\u6700\u65b0\u60c5\u5831\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\uff0e\u4eca\u5e7411\u6708\u306e\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u3066PHP 8.6\u306e\u958b\u767a\u304c\u672c\u683c\u5316\u3057\u3066\u3044\u307e\u3059\uff0e8\u6708\u306b\u4e88\u5b9a\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30ea\u30fc\u30ba\u306b\u5411\u3051\u3066\uff0cPHP 8.6\u306e\u65b0\u6a5f\u80fd\u304c\u307b\u307c\u51fa\u305d\u308d\u3063\u3066\u304d\u3066\u3044\u307e\u3059\uff0e\u4eca\u56de\u306f\uff0cPHP 8.6\u306e\u65b0\u6a5f\u80fd\u306e\u76ee\u7389\u3067\u3042\u308b\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%96%A2%E6%95%B0%E3%81%AE%E9%83%A8%E5%88%86%E9%81%A9%E7%94%A8%E3%81%A8%E3%81%AF%EF%BC%9F\"><\/span><strong>\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u3068\u306f\uff1f<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">PHP 8.6\u3067\u306f\uff0c\u300c\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\uff08Partial Function Application, PFA\uff09\u300d\u304c\u5c0e\u5165\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u3068\u306f\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u6642\u306b<strong>\u4e00\u90e8\u306e\u5f15\u6570\u3060\u3051\u3092\u5148\u306b\u6e21\u3057\u3001\u6b8b\u308a\u306e\u5f15\u6570\u3092\u5f8c\u304b\u3089\u53d7\u3051\u53d6\u308b\u95a2\u6570\uff08\u30af\u30ed\u30fc\u30b8\u30e3\uff09\u3092\u751f\u6210\u3059\u308b\u6a5f\u80fd<\/strong>\u3067\u3059\u3002&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f93\u6765\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306a\u3069\u3067\u4e00\u90e8\u306e\u5f15\u6570\u3092\u56fa\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30a2\u30ed\u30fc\u95a2\u6570\uff08fn()\uff09\u306a\u3069\u3092\u4f7f\u3063\u3066\u30e9\u30c3\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001PFA\u306e\u5c0e\u5165\u306b\u3088\u308a\u3053\u308c\u3092\u975e\u5e38\u306b\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP\u306b\u304a\u3051\u308b\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u306e\u5b9f\u88c5\u3067\u306f\uff0c\u5f15\u6570\u3092\u7701\u7565\u3057\u305f\u3044\u5834\u6240\u306b\uff0c\u4ee5\u4e0b\u306e2\u7a2e\u985e\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>?\uff08\u5358\u4e00\u5f15\u6570\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\uff09<\/strong>: \u305d\u306e\u4f4d\u7f6e\u306b<strong>\u6b63\u78ba\u306b1\u3064\u306e\u5f15\u6570<\/strong>\u304c\u671f\u5f85\u3055\u308c\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002&nbsp;<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>...\uff08\u53ef\u5909\u9577\u5f15\u6570\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\uff09<\/strong>: \u305d\u306e\u4f4d\u7f6e\u306b<strong>0\u500b\u4ee5\u4e0a\u306e\u5f15\u6570<\/strong>\u304c\u4f9b\u7d66\u3055\u308c\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002&nbsp;<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%83%A8%E5%88%86%E9%81%A9%E7%94%A8%EF%BC%88PFA%EF%BC%89%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9\"><\/span><strong>\u90e8\u5206\u9069\u7528\uff08PFA\uff09\u306e\u4f7f\u3044\u65b9<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u90e8\u5206\u9069\u7528\uff08PFA\uff09\u306f\uff0ePHP 8.1\u3067\u5c0e\u5165\u3055\u308c\u305f\u7b2c\u4e00\u7d1a\u30b3\u30fc\u30e9\u30d6\u30eb\uff08First-class&nbsp;callable\uff0cFCC\uff09\u306e\u6982\u5ff5\u3092\u3055\u3089\u306b\u62e1\u5f35\u3057\u305f\u3082\u306e\u3068\u8a00\u3048\u307e\u3059\u3002FCC\u306f\uff0c...\u306e\u307f\u3092\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3068\u3057\u3066\u4f7f\u3044\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u95a2\u6570\u306e\u30af\u30ed\u30fc\u30b8\u30e3\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u6a5f\u80fd\u3067\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$a =&nbsp;str_replace(...);&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u3053\u306e\u5834\u5408\uff0c$a&nbsp;\u306f\uff0cstr_replace&nbsp;\u95a2\u6570\u3068\u5168\u304f\u540c\u69d8\u306b\u52d5\u4f5c\u3057\u307e\u3059\uff0e\u4ee5\u4e0b\u306e\u7c21\u5358\u306a\u30b5\u30f3\u30d7\u30eb\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$text = \"Hello World\";&nbsp;\n\necho $a(\"Hello\", \"Goodbye\", $text), \"\\n\";<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u51fa\u529b\u306f\uff0c\u201dGoodbye World\u201d\u3068\u306a\u308a\uff0c\u7f6e\u63db\u5bfe\u8c61\u6587\u5b57\u5217$text\u306e\u201dHello\u201d\u304c\u201dGoodbye\u201d\u306b\u7f6e\u63db\u3055\u308c\u3066\u3044\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90e8\u5206\u9069\u7528\uff08PFA\uff09\u3092\u5229\u7528\u3059\u308b\u3068\uff0c\uff26\uff23\uff23\u3088\u308a\u3082\u81ea\u7531\u5ea6\u304c\u9ad8\u304f\u306a\u308a\uff0c\u95a2\u6570\u306e\u4e00\u90e8\u306e\u5f15\u6570\u3092\u56fa\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e\u5148\u307b\u3069\u306e\u4f8b\u306b\u3064\u3044\u3066\uff30\uff21\uff26\u3092\u4f7f\u3063\u3066\u66f8\u304d\u63db\u3048\u3066\u307f\u307e\u3057\u3087\u3046\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n$a =&nbsp;str_replace(\"Hello\", \"Goodbye\", ?);&nbsp;\n\necho $a($text), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u51fa\u529b\u306f\u540c\u3058\u306b\u306a\u308a\u307e\u3059\u304c\uff0c\u95a2\u6570\u306e\u30af\u30ed\u30fc\u30b8\u30e3\u3092\u4f5c\u6210\u3059\u308b\u969b\u306b\uff0cstr_replace\u00a0\u95a2\u6570\u306e\u7b2c1\u5f15\u6570\u3068\u7b2c2\u5f15\u6570\u3092\u6307\u5b9a\uff08\u56fa\u5b9a\uff09\u3057\uff0c\u7b2c3\u5f15\u6570\u306e\u307f?\u3092\u6307\u5b9a\u3057\u3066\u7701\u7565\u3057\u3066\u3044\u307e\u3059\uff0e\u3053\u308c\u306b\u3088\u308a\uff0c\u30af\u30ed\u30fc\u30b8\u30e3$a\u306f\uff0c\u7b2c3\u5f15\u6570\u306e\u307f\u3092\u5f15\u6570\u3068\u3059\u308b\u95a2\u6570\u3068\u306a\u308a\u307e\u3059\uff0e\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u5f93\u6765\uff0c\u3053\u306e\u3088\u3046\u306b\u4e00\u90e8\u306e\u5f15\u6570\u3092\u56fa\u5b9a\u3059\u308b\u306b\u306f\uff0c\u30a2\u30ed\u30fc\u95a2\u6570\u3092\u7528\u3044\u3066\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;$a = static&nbsp;fn($text) =&gt;&nbsp;str_replace(\"Hello\", \"Goodbye\", $text);&nbsp;\n\necho $a($text), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u30af\u30ed\u30fc\u30b8\u30e3$a\u306e\u52d5\u4f5c\u306fPFA\u3092\u7528\u3044\u305f\u5834\u5408\u3068\u540c\u69d8\u306b\u306a\u308a\u307e\u3059\u304c\uff0cPFA\u3092\u7528\u3044\u305f\u5834\u5408\u306b\u306f\u3088\u308a\u7c21\u6613\u7684\u306b\u8a18\u8ff0\u3067\u304d\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4e0a\u8a18\u306e\u4f8b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u540d\u524d\u4ed8\u304d\u306e\u5f15\u6570\u3067\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$a =&nbsp;str_replace(subject: ?, search: \"Hello\", replace: \"Goodbye\");&nbsp;\n\necho $a($text), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u51fa\u529b\u306f\u4e0a\u8a18\u306e\u4f8b\u3068\u540c\u3058\u306b\u306a\u308a\u307e\u3059\uff0esubject:&nbsp;\u306e\u3088\u3046\u306b\u540d\u524d\u3067\u6307\u5b9a\u3059\u308b\u5834\u5408\uff0c\u5f15\u6570\u306e\u9806\u5e8f\u306f\u4efb\u610f\u3068\u306a\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000FCC\u306e\u4f7f\u3044\u65b9\u306b\u4f3c\u3066\u3044\u307e\u3059\u304c\uff0cPFA\u3067\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3068\u3057\u3066&nbsp;...&nbsp;\u3092\u4f7f\u3046\u3068\uff0c\u6b8b\u308a\u306e\u5f15\u6570\uff08\u5f15\u6570\u306e\u6570\u306f\u4efb\u610f\uff09\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e\u4e0a\u8a18\u306e\u4f8b\u3092\u5c11\u3057\u66f8\u304d\u63db\u3048\u3066\u307f\u307e\u3057\u3087\u3046\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$a =&nbsp;str_replace(\"Hello\", ...);&nbsp;\n\necho $a(\"Goodbye\", $text), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u5834\u5408\uff0c\u7b2c1\u5f15\u6570\u306e\u307f\u304c\u56fa\u5b9a\u3055\u308c\uff0c\u30af\u30ed\u30fc\u30b8\u30e3$a\u306f\u7b2c2\u5f15\u6570\u4ee5\u964d\u3092\u5f15\u6570\u3068\u3059\u308b\u95a2\u6570\u3068\u306a\u308a\u307e\u3059\uff0e\u306a\u304a\uff0c\u3053\u306e\u4f8b\u3067\u306f\uff0cPHP\u306e\u7d44\u8fbc\u307f\u95a2\u6570\uff08str_replace\uff09\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u304c\uff0c\u4efb\u610f\u306e\u30e6\u30fc\u30b6\u5b9a\u7fa9\u95a2\u6570\u3067\u3082\u540c\u69d8\u306e\u52b9\u679c\u304c\u5f97\u3089\u308c\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%82%AA%E3%83%97%E3%82%B7%E3%83%A7%E3%83%B3%E3%83%91%E3%83%A9%E3%83%A1%E3%83%BC%E3%82%BF%E3%81%AE%E6%89%B1%E3%81%84\"><\/span><strong>\u30aa\u30d7\u30b7\u30e7\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6271\u3044<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u90e8\u5206\u9069\u7528\uff08PFA\uff09\u306b\u304a\u3051\u308b\u975e\u5e38\u306b\u91cd\u8981\u306a\u4ed5\u69d8\u3068\u3057\u3066\u3001<strong>?&nbsp;\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u305f\u5f15\u6570\u306f\uff0c\u5143\u306e\u95a2\u6570\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u6301\u3064\u30aa\u30d7\u30b7\u30e7\u30f3\u5f15\u6570\u3067\u3042\u3063\u305f\u3068\u3057\u3066\u3082\uff0c\u5e38\u306b\u300c\u5fc5\u9808\uff08non-optional\uff09\u300d\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u6271\u308f\u308c\u308b<\/strong>\u3068\u3044\u3046\u70b9\u304c\u3042\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u306f\u3001\u90e8\u5206\u9069\u7528\u3055\u308c\u305f\u95a2\u6570\u306f\u7279\u5b9a\u306e\u30b7\u30b0\u30cd\u30c1\u30e3\u3092\u671f\u5f85\u3059\u308b\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3068\u3057\u3066\u6e21\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u304f\uff0c\u5f15\u6570\u304c\u7701\u7565\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u306b\u4f9d\u5b58\u3059\u3079\u304d\u3067\u306f\u306a\u3044\u305f\u3081\u3067\u3059\u3002\u3053\u306e\u4ed5\u69d8\u306b\u3088\u308a\uff0c\u4e88\u6e2c\u4e0d\u53ef\u80fd\u306a\u6319\u52d5\u304c\u9632\u304c\u308c\u3001\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u306b\u3088\u308b\u578b\u30c1\u30a7\u30c3\u30af\u3082\u6b63\u78ba\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff0e&nbsp;\u305f\u3060\u3057\u3001... \u3067\u5f15\u304d\u7d99\u304c\u308c\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u95a2\u3057\u3066\u306f\u3001\u5143\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u6027\u304c\u7dad\u6301\u3055\u308c\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u6271\u3044\u306b\u95a2\u3059\u308b\u4ed5\u69d8\u306f\uff0c\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u63d0\u6848\uff08RFC\uff09\u306e\u5f8c\u306b\u958b\u767a\u8005\u306e\u8b70\u8ad6\u3092\u7d4c\u3066\u4e00\u90e8\u5909\u66f4\u30fb\u660e\u78ba\u5316\u3055\u308c\u305f\u3082\u306e\u3068\u306a\u308a\u307e\u3059\uff0e\u5c11\u3057\u308f\u304b\u308a\u306b\u304f\u3044\u306e\u3067\u5177\u4f53\u7684\u306a\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function&nbsp;concat(string&nbsp;$a=\u2019a\u2019,&nbsp;string $b = 'b', string $c = 'c') {&nbsp;\n\nreturn $a .&nbsp;$b .&nbsp;$c;&nbsp;\n\n}&nbsp;\n\n$foo&nbsp;=&nbsp;concat(?,&nbsp;?);&nbsp;\n\necho $foo(\"A\", \"B\"), \"\\n\";<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\uff0c\u5f15\u6570\u6587\u5b57\u5217\u3092\u7d50\u5408\u3057\u3066\u8fd4\u3059\u30e6\u30fc\u30b6\u5b9a\u7fa9\u95a2\u6570concat\u3092\u5b9a\u7fa9\u3057\u307e\u3059\uff0e\u3053\u306e\u95a2\u6570\u306e\u7b2c2\u5f15\u6570\u304a\u3088\u3073\u7b2c3\u5f15\u6570\u306b\u306f\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\uff0e\u90e8\u5206\u9069\u7528(PFA)\u3092\u7528\u3044\u3066\u7b2c1\uff0c\u7b2c2\u5f15\u6570\u306b\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u201d?\u201d\u3092\u6307\u5b9a\u3057\u3066\u30af\u30ed\u30fc\u30b8\u30e3$foo\u3092\u4f5c\u6210\u3057\u307e\u3059\uff0e\u3053\u306e\u4f8b\u306e\u51fa\u529b\u306f\uff0c\u201dABc\u201d\u3068\u306a\u308a\u307e\u3059\uff0e3\u756a\u76ee\u306e\u5f15\u6570\u306b\u306f\u5143\u306e\u95a2\u6570concat\u306b\u304a\u3051\u308b\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff08optional\uff09\u304c\u9069\u7528\u3055\u308c\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3057\u304b\u3057\uff0c\u5143\u306e\u95a2\u6570\u306e\u7b2c2\u5f15\u6570\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u304c\u9069\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3089\u3068\u3044\u3063\u3066\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u7b2c2\u5f15\u6570\u3092\u7701\u7565\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $foo(\"A\"), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u307e\u3059\uff0e\u3053\u306e\u7406\u7531\u306f\uff0c\u672c\u7bc0\u306e\u5192\u982d\u3067\u8ff0\u3079\u305f\u3088\u3046\u306b\uff0c?\u3092\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3068\u3057\u3066\u6307\u5b9a\u3057\u305f\u5834\u5408\uff0c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u6307\u5b9a\u306b\u3088\u3089\u305a\u5fc5\u9808\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u308b\u305f\u3081\u3067\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4e00\u65b9\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3068\u3057\u3066...\u3092\u7528\u3044\u305f\u5834\u5408\uff0c\u7701\u7565\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$foo =&nbsp;concat(?,&nbsp;...);&nbsp;\n\necho $foo(\"A\"), \"\\n\";&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u5834\u5408\u306e\u51fa\u529b\u306f&nbsp;Abc&nbsp;\u3068\u306a\u308a\uff0c\u30a8\u30e9\u30fc\u3092\u767a\u751f\u3057\u307e\u305b\u3093\uff0e&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%82%A2%E3%83%AD%E3%83%BC%E9%96%A2%E6%95%B0%E3%81%A8%E3%81%AE%E8%A9%95%E4%BE%A1%E9%A0%86%E5%BA%8F%E3%81%AE%E9%81%95%E3%81%84\"><\/span><strong>\u30a2\u30ed\u30fc\u95a2\u6570\u3068\u306e\u8a55\u4fa1\u9806\u5e8f\u306e\u9055\u3044<\/strong>&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u5f93\u6765\u306e\u30a2\u30ed\u30fc\u95a2\u6570\uff08fn()\uff09\u304b\u3089PFA\u306b\u4e57\u308a\u63db\u3048\u3088\u3046\u3068\u3059\u308b\u5834\u5408\uff0c\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u5dee\u7570\u304c\u4e00\u3064\u3042\u308a\u307e\u3059\uff0e\u5f93\u6765\u306e\u30a2\u30ed\u30fc\u95a2\u6570\uff08fn()\uff09\u3067\u30e9\u30c3\u30d7\u3057\u305f\u5834\u5408\u3001\u5185\u90e8\u306e\u95a2\u6570\u306b\u6e21\u3055\u308c\u308b\u5f15\u6570\u306e\u8a55\u4fa1\u306f\u300c\u30af\u30ed\u30fc\u30b8\u30e3\u304c\u5b9f\u884c\u3055\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u300d\u3067\u884c\u308f\u308c\u307e\u3059\u3002 \u4e00\u65b9\u3001PFA\u3067\u306f<strong>\u30af\u30ed\u30fc\u30b8\u30e3\u304c\u300c\u751f\u6210\u3055\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u300d\u3067\u5f15\u6570\u306e\u5f0f\u304c\u4e8b\u524d\u306b\u8a55\u4fa1\u3055\u308c\u3001\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u307e\u3059<\/strong>\u3002&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4f8b\u3068\u3057\u3066\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b2\u500b\u306e\u6574\u6570\u3092\u5f15\u6570\u3068\u3059\u308b\u95a2\u6570&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">foo\u3092\u5b9a\u7fa9\u3057\uff0c\u73fe\u5728\u6642\u523btime()\u3092\u5f15\u6570\u3068\u3057\u3066\u7b2c1\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f\u30af\u30ed\u30fc\u30b8\u30e3$f\u3092\u5b9a\u7fa9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function&nbsp;foo(int $a, int $b): string&nbsp;{&nbsp;\n\n\u202f \u202f return \"$a =&gt; $b\";&nbsp;\n\n}\n\n$f = foo(time(), ?);&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u30af\u30ed\u30fc\u30b8\u30e3\u30921\u79d2\u6bce\u306b\u547c\u3073\u51fa\u3057\u3066\u307f\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for ($i&nbsp;= 0; $i&nbsp;&lt; 5; $i++) {&nbsp;\necho $f($i), \"\\n\";&nbsp;\n\n\u202f \u202f&nbsp;sleep(1); \/\/&nbsp;1\u79d2\u5f85\u3064&nbsp;\n\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u51fa\u529b\u306f\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\uff0c\u6642\u523b\u306e\u90e8\u5206\u304c\u5909\u308f\u3089\u306a\u3044\uff081785637693\u306e\u307e\u307e\u4e00\u5b9a\uff09\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\uff0e\u306a\u304a\uff0c\u6642\u523b\u306e\u90e8\u5206\u306f\u5b9f\u884c\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306b\u4f9d\u5b58\u3057\u3066\u7570\u306a\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1785637693 =&gt; 0&nbsp;\n1785637693 =&gt; 1&nbsp;&nbsp;\n1785637693 =&gt; 2&nbsp;&nbsp;\n1785637693 =&gt; 3&nbsp;&nbsp;\n1785637693 =&gt; 4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306b\uff0c\u540c\u69d8\u306b1\u756a\u76ee\u306e\u5f15\u6570\u3092\u6642\u523b\u3067\u56fa\u5b9a\u3059\u308b\u30a2\u30ed\u30fc\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$f =&nbsp;fn($x) =&gt; foo(time(), $x);&nbsp;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u95a2\u6570\u306e\u51fa\u529b\u306f\uff0c\u4f8b\u3048\u3070\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\uff0c\u6642\u523b\u306e\u90e8\u5206\u304c\uff11\u79d2\u6bce\u306b\u5909\u5316\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1785637698 =&gt; 0&nbsp;\n1785637699 =&gt; 1&nbsp;&nbsp;\n1785637700 =&gt; 2&nbsp;&nbsp;\n1785637701 =&gt; 3&nbsp;&nbsp;\n1785637702 =&gt; 4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u306f\uff0c\u5148\u8ff0\u306e\u901a\u308a\uff0c\u30a2\u30ed\u30fc\u95a2\u6570\u306e\u5834\u5408\u306f\uff0c\u5b9f\u884c\u6642\u306b\u5f15\u6570\uff08time()\uff09\u304c\u8a55\u4fa1\u3055\u308c\u308b\u305f\u3081\u3067\u3059\uff0e\u4e00\u65b9\uff0cPFA\u306e\u5834\u5408\u306f\uff0c\u30af\u30ed\u30fc\u30b8\u30e3\u304c\u751f\u6210\u3055\u308c\u305f\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u5f15\u6570\u304c\u4e00\u5ea6\u3060\u3051\u8a55\u4fa1\u3055\u308c\u308b\u305f\u3081\uff0c\u6642\u523b\u306e\u5024\u306f\u4e00\u5b9a\u3068\u306a\u308a\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E3%83%91%E3%82%A4%E3%83%97%E6%BC%94%E7%AE%97%E5%AD%90%E3%81%B8%E3%81%AE%E9%81%A9%E7%94%A8%E6%99%82%E3%81%AE%E6%9C%80%E9%81%A9%E5%8C%96\"><\/span><strong>\u30d1\u30a4\u30d7\u6f14\u7b97\u5b50\u3078\u306e\u9069\u7528\u6642\u306e\u6700\u9069\u5316&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000PFA\u306f\uff0cPHP&nbsp;8.5\u3067\u5c0e\u5165\u3055\u308c\u305f\u30d1\u30a4\u30d7\u6f14\u7b97\u5b50\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff0e\u4f8b\u3048\u3070\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u306b\u306a\u308a\u307e\u3059\uff0e\u3053\u3053\u3067\u306f\uff0cstr_replace\u95a2\u6570\u3067\u6587\u5b57\u5217\u7f6e\u63db\u3092\u884c\u3063\u305f\u5f8c\uff0c\uff53\uff54\uff52toupper\u95a2\u6570\u3067\u5927\u6587\u5b57\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$test = \"Hello World\";&nbsp;\n\necho $test |&gt;&nbsp;str_replace(\"Hello\", \"Goodbye\", ?)&nbsp;|&gt;&nbsp;strtoupper(?);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u51fa\u529b\u306f\uff0cGOOBYE WORLD\u3068\u306a\u308a\u307e\u3059\uff0e\u30d1\u30a4\u30d7\u6f14\u7b97\u5b50\u3067PFA\u3092\u5229\u7528\u3059\u308b\u969b\uff0c\u5f15\u6570\u304c1\u3064\u306e\u307f\u306e\u30b1\u30fc\u30b9\u3067\u306f\uff0c\u30af\u30ed\u30fc\u30b8\u30e3\u306e\u751f\u6210\u3092\u7701\u7565\u3057\u3066FCC\u3068\u540c\u69d8\u306e\u76f4\u63a5\u547c\u51fa\u3057\u3092\u884c\u3046\u3088\u3046\u306b\uff0c\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u6700\u9069\u5316\u3092\u884c\u3044\u307e\u3059\uff0e\u3053\u308c\u306b\u3088\u308a\uff0c\u6027\u80fd\u4e0a\u306e\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u3092\u307b\u307c\u30bc\u30ed\u306b\u6291\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u306f\u3001\u6b21\u671f\u30de\u30a4\u30ca\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3042\u308bPHP 8.6\u3067\u5c0e\u5165\u3055\u308c\u308b\u65b0\u6a5f\u80fd\u306e\u3046\u3061\uff0c\u6700\u5927\u306e\u76ee\u7389\u306b\u306a\u308b\u3068\u601d\u308f\u308c\u308b\u90e8\u5206\u9069\u7528\uff08\uff30\uff26\uff21\uff09\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3057\u305f\uff0e\u4eca\u56de\u7d39\u4ecb\u3057\u305f\u5909\u66f4\u70b9\u3082\u542b\u3081\u3066\uff0c\u30d5\u30a3\u30fc\u30c1\u30e3\u30fc\u30d5\u30ea\u30fc\u30ba\u307e\u3067\u306f\u5909\u66f4\u304c\u884c\u308f\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\u6b21\u56de\u4ee5\u964d\u3082PHP 8.6\u306e\u65b0\u305f\u306a\u6a5f\u80fd\u3084\u5909\u66f4\u70b9\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u3066\u3044\u304f\u4e88\u5b9a\u3067\u3059\uff0e&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u9023\u8f09\u306b\u304a\u3044\u3066\u306f\uff0cPHP\u754c\u9688\u306e\u6700\u65b0\u60c5\u5831\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\uff0e\u4eca\u5e7411\u6708\u306e\u6b63\u5f0f\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u3066PHP 8.6\u306e\u958b\u767a\u304c\u672c\u683c\u5316\u3057\u3066\u3044\u307e\u3059\uff0e8\u6708\u306b\u4e88\u5b9a\u3055 ... <a title=\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1a\u00a0PHP\u00a08.6\u00a0\u3067\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u304c\u5c0e\u5165\u3055\u308c\u308b\u00a0\uff08\u7b2c47\u56de\uff09\" class=\"read-more\" href=\"https:\/\/kusanagi.tokyo\/column\/archives\/column_12061\" aria-label=\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1a\u00a0PHP\u00a08.6\u00a0\u3067\u95a2\u6570\u306e\u90e8\u5206\u9069\u7528\u304c\u5c0e\u5165\u3055\u308c\u308b\u00a0\uff08\u7b2c47\u56de\uff09 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">Read more<\/a><\/p>\n","protected":false},"author":14,"featured_media":9688,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[15],"tags":[],"series":[],"journey":[],"product":[],"class_list":["post-12061","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33","no-featured-image-padding"],"_links":{"self":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/12061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/comments?post=12061"}],"version-history":[{"count":13,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/12061\/revisions"}],"predecessor-version":[{"id":12081,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/12061\/revisions\/12081"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/media\/9688"}],"wp:attachment":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/media?parent=12061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/categories?post=12061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/tags?post=12061"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/series?post=12061"},{"taxonomy":"journey","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/journey?post=12061"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/product?post=12061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}