{"id":1581,"date":"2023-07-04T19:46:35","date_gmt":"2023-07-04T10:46:35","guid":{"rendered":"https:\/\/clouds.tokyo\/blog\/?p=1581"},"modified":"2023-10-03T20:09:08","modified_gmt":"2023-10-03T11:09:08","slug":"php8-create-function","status":"publish","type":"post","link":"https:\/\/clouds.tokyo\/blog\/php8-create-function\/","title":{"rendered":"\u3010PHP8\u3011create_function \u3092 eval \u306b\u7f6e\u304d\u304b\u3048\u308b"},"content":{"rendered":"<p>\u4ee5\u524d\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u306ePHP8\u5bfe\u5fdc\u306e\u4f9d\u983c\u3092\u53d7\u3051\u308b\u3053\u3068\u304c\u5897\u3048\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>PHP8\u3067\u306fcreate_function\u304c\u4f7f\u7528\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u306e\u3067<br \/>\n\u4ee3\u308f\u308a\u306beval\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30fc\u30c9\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u52d5\u7684\u306b\u751f\u6210\u3057\u3066\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408\u306a\u3069\u3067<br \/>\ncreate_function\u3092\u4f7f\u7528\u3057\u3066\u3044\u305f\u65b9\u3082\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\n$func = create_function(\"\", \"return $code;\");\r\nreturn $func();\r\n<\/pre>\n<p>eval\u3067\u540c\u3058\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\r\neval('$ret = ' . $code . ';');\r\nreturn $ret;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u65e2\u5b58\u30b7\u30b9\u30c6\u30e0\u306ePHP8\u5bfe\u5fdc\u306e\u4f9d\u983c\u3092\u53d7\u3051\u308b\u3053\u3068\u304c\u5897\u3048\u3066\u304d\u307e\u3057\u305f\u3002 PHP8\u3067\u306fcreate_function\u304c\u4f7f\u7528\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u306e\u3067 \u4ee3\u308f\u308a\u306beval\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 \u30b3\u30fc\u30c9\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u52d5\u7684\u306b\u751f\u6210\u3057 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/clouds.tokyo\/blog\/php8-create-function\/\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010PHP8\u3011create_function \u3092 eval \u306b\u7f6e\u304d\u304b\u3048\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":""},"categories":[2],"tags":[597,600,601],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pezW3u-pv","jetpack-related-posts":[{"id":223,"url":"https:\/\/clouds.tokyo\/blog\/php_sendmail\/","url_meta":{"origin":1581,"position":0},"title":"\u3010PHP\u3011\u30b7\u30f3\u30d7\u30eb\u306b\u30e1\u30fc\u30eb\u9001\u4fe1","author":"yamamoto","date":"2010\u5e742\u670826\u65e5","format":false,"excerpt":"\u30b7\u30f3\u30d7\u30eb\u306a\u65e5\u672c\u8a9e\u30e1\u30fc\u30eb\u9001\u4fe1\u30af\u30e9\u30b9\u3067\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u306fUTF-8\u3068\u3057\u305f\u5834\u5408\u3002 class ma\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":217,"url":"https:\/\/clouds.tokyo\/blog\/php_csv_read\/","url_meta":{"origin":1581,"position":1},"title":"\u3010PHP\u3011CSV\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f","author":"yamamoto","date":"2008\u5e742\u67084\u65e5","format":false,"excerpt":"\u3044\u308d\u3093\u306a\u65b9\u6cd5\u304c\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001 str_getcsv() \u3092\u4f7f\u3063\u305f\u65b9\u6cd5\u3067\u3059\u3002 function \u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":220,"url":"https:\/\/clouds.tokyo\/blog\/php_crypt\/","url_meta":{"origin":1581,"position":2},"title":"\u3010PHP\u3011\u30b7\u30f3\u30d7\u30eb\u306b\u6697\u53f7\u5316\u30fb\u5fa9\u53f7\u5316\u3059\u308b","author":"yamamoto","date":"2013\u5e741\u670811\u65e5","format":false,"excerpt":"2018\/3\/13 \u8ffd\u8a18\uff1a PHP7.1\u3067\u975e\u63a8\u5968\u306b\u306a\u308a\u307e\u3057\u305f\u3002OpenSSL\u3092\u4f7f\u3063\u305f\u3053\u3061\u3089\u3092\u3054\u53c2\u7167\u304f\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":233,"url":"https:\/\/clouds.tokyo\/blog\/php_vd_filetype\/","url_meta":{"origin":1581,"position":3},"title":"\u3010PHP\u3011\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u306e\u30c1\u30a7\u30c3\u30af","author":"yamamoto","date":"2007\u5e741\u670815\u65e5","format":false,"excerpt":"\u306a\u306b\u3082\u96e3\u3057\u3044\u3053\u3068\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001 \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u62e1\u5f35\u5b50\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002 publi\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":886,"url":"https:\/\/clouds.tokyo\/blog\/linux_vi_paste\/","url_meta":{"origin":1581,"position":4},"title":"\u3010Linux\u3011vi\u3067\u30da\u30fc\u30b9\u30c8\u3057\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u30a4\u30f3\u30c7\u30f3\u30c8\u3084\u30b3\u30e1\u30f3\u30c8\u304c\u5d29\u308c\u308b","author":"yamamoto","date":"2017\u5e7411\u670821\u65e5","format":false,"excerpt":"vi\u306b\u306f\u6a19\u6e96\u3067\u81ea\u52d5\u30a4\u30f3\u30c7\u30f3\u30c8\u3084\u81ea\u52d5\u30b3\u30e1\u30f3\u30c8\u884c\u306e\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u304c\u3001 \u305d\u306e\u5f0a\u5bb3\u3068\u3057\u3066\u3001\u30a4\u30f3\u30c7\u30f3\u30c8\u3084\u30b3\u30e1\u30f3\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":977,"url":"https:\/\/clouds.tokyo\/blog\/php_crypt2\/","url_meta":{"origin":1581,"position":5},"title":"\u3010PHP\u3011PHP7.1\u3067\u6697\u53f7\u5316\u30fb\u5fa9\u53f7\u5316","author":"yamamoto","date":"2018\u5e743\u670814\u65e5","format":false,"excerpt":"5\u5e74\u524d\u306b\u66f8\u3044\u305f\u8a18\u4e8b \u3010PHP\u3011\u30b7\u30f3\u30d7\u30eb\u306b\u6697\u53f7\u5316\u30fb\u5fa9\u53f7\u5316\u3059\u308b \u306e\u5185\u5bb9\u304cPHP7.1\u3067\u306f\u975e\u63a8\u5968\u306b\u306a\u3063\u3066\u3057\u2026","rel":"","context":"\u5099\u5fd8\u9332","block_context":{"text":"\u5099\u5fd8\u9332","link":"https:\/\/clouds.tokyo\/blog\/category\/memo\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1581"}],"collection":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/comments?post=1581"}],"version-history":[{"count":1,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1581\/revisions"}],"predecessor-version":[{"id":1582,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/posts\/1581\/revisions\/1582"}],"wp:attachment":[{"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/media?parent=1581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/categories?post=1581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/clouds.tokyo\/blog\/wp-json\/wp\/v2\/tags?post=1581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}