{"id":3612,"date":"2020-03-02T08:08:15","date_gmt":"2020-03-01T23:08:15","guid":{"rendered":"https:\/\/column.prime-strategy.co.jp\/?p=3612"},"modified":"2026-02-17T02:10:45","modified_gmt":"2026-02-16T17:10:45","slug":"post-3612","status":"publish","type":"post","link":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612","title":{"rendered":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09"},"content":{"rendered":"\n<p>2020\u5e74\u30822\u304b\u6708\u304c\u904e\u304e\u3001PHP\u306e\u958b\u767a\u306f\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u306e8.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u3093\u3067\u3044\u307e\u3059\u3002\u9806\u8abf\u306b\u958b\u767a\u304c\u9032\u3081\u30702020\u5e74\u672b\u307e\u3067\u306bPHP 8.0\u306e\u30ea\u30ea\u30fc\u30b9\u304c\u884c\u308f\u308c\u308b\u3053\u3068\u304c\u4e88\u60f3\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u73fe\u6642\u70b9\u3067\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>PHP 8.0\u306e\u6700\u5927\u306e\u5f37\u5316\u70b9\u306fJIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306e\u5c0e\u5165\u306b\u3088\u308b\u9ad8\u901f\u5316\u3068\u306a\u308a\u307e\u3059\u3002JIT\u306b\u3064\u3044\u3066\u306f\u3053\u306e\u30b3\u30e9\u30e0\u3067\u7d39\u4ecb\u3057\u3066\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u4eca\u56de\u304b\u3089\u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9\u306b\u3064\u3044\u3066\u3001\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">PHP 8.0\u306e\u65b0\u6a5f\u80fd<\/h1>\n\n\n\n<p>\u4eca\u56de\u306f\u3001PHP 8\u306b\u304a\u3051\u308bJIT\u4ee5\u5916\u306e\u6a5f\u80fd\u5f37\u5316\u70b9\u3068\u3057\u3066\u3001\u8a00\u8a9e\u306b\u95a2\u9023\u3059\u308b\u4ee5\u4e0b\u306e\u9805\u76ee\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3044\u305a\u308c\u306e\u6a5f\u80fd\u3082PHP\n7.4\u307e\u3067\u306b\u5c0e\u5165\u3055\u308c\u305f\u6a5f\u80fd\u3092\u3055\u3089\u306b\u5f37\u5316\u3057\u305f\u3082\u306e\u3067\u3001PHP\u306b\u3088\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Union\u578b\u306e\u5c0e\u5165<\/li><li>static\u578b\u623b\u308a\u5024\u6307\u5b9a<\/li><li>\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0<\/li><li>::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528<\/li><\/ol>\n\n\n\n<h1 class=\"wp-block-heading\">Union\u578b\u306e\u5c0e\u5165<\/h1>\n\n\n\n<p>PHP\u3067\u306f\u3001\u30bf\u30a4\u30d7\u30d2\u30f3\u30c6\u30a3\u30f3\u30b0\u306b\u3088\u308a\u3001\u95a2\u6570\uff08\u30e1\u30bd\u30c3\u30c9\uff09\u306e\u5165\u529b\u578b\u304a\u3088\u3073\u623b\u308a\u5024\u306e\u578b\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002\u5f93\u6765\u3001\u3053\u306e\u578b\u306f1\u7a2e\u985e\u306e\u307f\u304c\u6307\u5b9a\u53ef\u80fd\u3067\u3057\u305f\u304c\u3001PHP 8.0\u3067\u306fUnion\u578b\u3068\u3057\u3066\u2019|\u2019\u3092\u631f\u3093\u3067\u8907\u6570\u306e\u578b\u306e\u5019\u88dc\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30b9\u30c8 1 Union\u578b\u306e\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nclass Test {\n    public int|float $x;\n    public function foo(Foo|Bar $in) : int|float {\n        return 1.23;\n    }\n}\n\nclass Foo {};\nclass Bar {};\n\n$obj = new Test();\n$obj->foo(123); \/\/ Fatal error\n$obj->foo(new Foo); \/\/ 1.23\n$obj->x = \"123\";\u3000\nvar_dump($obj->x); \/\/ int(123)\n$obj->x = \"1.23\";\nvar_dump($obj->x); \/\/ float(1.23)<\/code><\/pre>\n\n\n\n<p>\u30ea\u30b9\u30c81\u306bUnion\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u793a\u3057\u307e\u3059\u3002Test\u30af\u30e9\u30b9\u306efoo\u30e1\u30bd\u30c3\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5ba3\u8a00\u3055\u308c\u3066\u304a\u308a\u3001\u5f15\u6570\u3068\u3057\u3066Foo\u30af\u30e9\u30b9\u307e\u305f\u306fBar\u30af\u30e9\u30b9\u3092\u53d7\u3051\u53d6\u308a\u3001int\u307e\u305f\u306ffloat\u578b\u306e\u623b\u308a\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function foo(Foo|Bar $in) : int|float {<\/code><\/pre>\n\n\n\n<p>null\u3092\u8a31\u5bb9\u3059\u308b(nullable)\u5834\u5408\u306b\u306f\u3001Foo|Bar|null \u306e\u3088\u3046\u306b null \u3092\u5f15\u6570\u306b\u542b\u3081\u307e\u3059\u3002?Foo\u306e\u3088\u3046\u306a\u7701\u7565\u8a18\u6cd5\u306fUnion\u3068\u4f75\u7528\u3057\u3066\u4f7f\u7528\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u3000\u3053\u3053\u3067\u3001Foo\u307e\u305f\u306fBar\u4ee5\u5916\u306e\u5024\u3092\u5f15\u6570\u3068\u3057\u3066\u5165\u529b\u3059\u308b\u3068\u3001\u81f4\u547d\u7684\u306a\u30a8\u30e9\u30fc(Fatal error)\u3092\u767a\u751f\u3057\u307e\u3059\uff0813\u884c\u76ee\uff09\u3002<\/p>\n\n\n\n<p>\u30d7\u30ed\u30d1\u30c6\u30a3\u5909\u6570\u306b\u3064\u3044\u3066\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306bUnion\u306b\u3088\u308b\u8907\u6570\u578b\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public int|float $x;<\/code><\/pre>\n\n\n\n<p>\u3000\u6587\u5b57\u5217\u3067\u6570\u5024\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001Union\u306e\u9078\u629e\u80a2\u306e\u4e2d\u306b\u3042\u308b\u578b(\u3053\u306e\u5834\u5408\u306fint\u307e\u305f\u306ffloat)\u306b\u3064\u3044\u3066\u3001PHP\u306e\u5f93\u6765\u306e\u5909\u63db\u30eb\u30fc\u30eb\u306b\u3088\u308a\u6574\u6570\u306fint\u578b\u3001\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306ffloat\u578b\u306b\u5909\u63db\u3055\u308c\u307e\u3059(15\uff5e18\u884c\u76ee)\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">static\u578b\u623b\u308a\u5024\u6307\u5b9a<\/h1>\n\n\n\n<p>\u3000PHP 8.0\u3067\u306f\u3001\u95a2\u6570\u30fb\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u306b\u7279\u6b8a\u306a\u30af\u30e9\u30b9\u540dstatic\u3092\u4ed8\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u9045\u5ef6\u9759\u7684\u675f\u7e1b(late static binding)\u304c\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u3053\u3067\u3001static\u304c\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u623b\u308a\u5024\u306e\u578b\u6307\u5b9a\u306e\u307f\u3067\u3042\u308a\u3001\u5165\u529b\u5f15\u6570\u3084\u30d7\u30ed\u30d1\u30c6\u30a3\u5909\u6570\u306e\u578b\u6307\u5b9a\u3067\u306f\u4f7f\u7528\u3067\u304d\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30ea\u30b9\u30c82\u306b\u7c21\u5358\u306a\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\u307e\u305a\u3001\u30e1\u30bd\u30c3\u30c9gen1,gen2\u3092\u6709\u3059\u308b\u30af\u30e9\u30b9A\u3068\u3001\u30af\u30e9\u30b9A\u306e\u6d3e\u751f\u30af\u30e9\u30b9B\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002gen1\u30e1\u30bd\u30c3\u30c9\u306fnew self\u306b\u3088\u308a\u81ea\u8eab\u306e\u65b0\u898f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059\u304c\u3001\u6d3e\u751f\u30af\u30e9\u30b9B\u3067\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u7528\u3044\u305f\u5834\u5408\u3067\u3082\u3001\u89aa\u30af\u30e9\u30b9\u3067\u3042\u308b\u30af\u30e9\u30b9A\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059(10\u884c\u76ee)\u3002\u4e00\u65b9\u3001gen2\u30e1\u30bd\u30c3\u30c9\u3067\u306fstatic\u30af\u30e9\u30b9\u3092\u8fd4\u3059\u305f\u3081\u3001\u6d3e\u751f\u30af\u30e9\u30b9B\u3067\u30b3\u30fc\u30eb\u3055\u308c\u308b\u3068\u30af\u30e9\u30b9B\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059(11\u884c\u76ee)\u3002<\/p>\n\n\n\n<p>\u3053\u3053\u3067\u3001PHP 8\u304b\u3089\u5c0e\u5165\u3055\u308c\u305f\u623b\u308a\u5024\u306estatic\u578b\u6307\u5b9a\u3092\u884c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u5177\u4f53\u7684\u306b\u306f3\u30014\u884c\u76ee\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function gen1():static { return new self; }\npublic function gen2():static { return new static; }<\/code><\/pre>\n\n\n\n<p>\u3000\u3053\u306e\u5834\u5408\u3001\u623b\u308a\u5024\u304cstatic\u3067\u306a\u304410\u884c\u76ee\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306aTypeError\u3092\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TypeError: Return value of A::gen1() must be of Type B, A returned<\/code><\/pre>\n\n\n\n<p>\u3000static\u578b\u6307\u5b9a\u306b\u3088\u308b\u578b\u30c1\u30a7\u30c3\u30af\u304c\u6a5f\u80fd\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30b9\u30c8 2 static\u578b\u623b\u308a\u5024\u6307\u5b9a\u306e\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nclass A {\n    public function gen1() { return new self; }\n    public function gen2() { return new static; }\n}\nclass B extends A {}\n\n$a = new A;\n$b = new B;\nvar_dump($b->gen1()); \/\/ object(A)#3\nvar_dump($b->gen2()); \/\/ object(B)#3<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0<\/h1>\n\n\n\n<p>PHP 7.4\u3067\u5f31\u3044\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u304c\u5c0e\u5165\u3055\u308c\u307e\u3057\u305f\u304c\u3001\u7834\u68c4\u6642\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u304c\u63d0\u4f9b\u3055\u308c\u306a\u304b\u3063\u305f\u305f\u3081\u3001\u305d\u306e\u7528\u9014\u306f\u9650\u5b9a\u7684\u3067\u3057\u305f\u3002PHP 8\u3067\u306f\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0(Weak maps)\u304c\u5c0e\u5165\u3055\u308c\u307e\u3059\u3002\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002\u3053\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5bfe\u8c61\u306e\u5bfe\u8c61\u3068\u306a\u308b\u3053\u3068\u3092\u59a8\u3052\u307e\u305b\u3093\u3002\u3042\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ad\u30fc\u304c\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5bfe\u8c61\u3068\u306a\u3063\u305f\u5834\u5408\u3001\u5f53\u8a72\u30de\u30c3\u30d4\u30f3\u30b0\u306f\u524a\u9664\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30b9\u30c83\u306b\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$map\u3092\u4f5c\u6210\u3057\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$obj\u3092\u30ad\u30fc\u3068\u3057\u3066\u3001\u5024\u3092\u4ee3\u5165\u3057\u307e\u3059\u3002\u3053\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$obj\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u3092\u5024\u3068\u3057\u3066\u4ee3\u5165\u3057\u307e\u3059(4\u884c\u76ee)\u3002\u5909\u6570$map\u3092\u30c0\u30f3\u30d7\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51fa\u529b\u3068\u306a\u308a\u3001\u914d\u5217\u306e\u30ad\u30fc\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3001\u5024\u306b\u4ee3\u5165\u3057\u305f\u5024\u304c\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059(5\u884c\u76ee)\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>object(WeakMap)#1 (1) {\n  &#91;0]=>array(2) {\n    &#91;\"key\"]=>object(stdClass)#2 (0) {}\n    &#91;\"value\"]=>string(32) \"000000001c2bbea3000000007d9890f1\"\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u5909\u6570$map\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ad\u30fc\u3068\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u4ee3\u5165\u3057\u305f\u5024\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059(6\u884c\u76ee)\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u4ee3\u5165\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$obj\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$obj\u3092\u524a\u9664\u5f8c\u3001\u5909\u6570$map\u3092\u518d\u5ea6\u30c0\u30f3\u30d7\u3059\u308b\u3068\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8$obj\u3078\u306e\u53c2\u7167\u304c\u524a\u9664\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059(8\u884c\u76ee)\u3002\u901a\u5e38\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u4ee3\u5165\u306e\u5834\u5408\u306b\u306f\u3001\u5143\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u524a\u9664\u3057\u3066\u3082\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u304c\u6b8b\u308b\u305f\u3081\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b9f\u4f53\u306f\u524a\u9664\u3055\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u5834\u5408\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5b9f\u4f53\u306f\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5bfe\u8c61\u3068\u306a\u308a\u3001\u9006\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30b9\u30c8 3 \u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n$map = new WeakMap;\n$obj = new stdClass;\n$map&#91;$obj] = spl_object_hash($obj);\nvar_dump($map);        \/\/ object(WeakMap)#1 (1)\nvar_dump($map&#91;$obj]); \/\/  $obj\u306e\u30cf\u30c3\u30b7\u30e5\u5024\nunset($obj);\nvar_dump($map);       \/\/ object(WeakMap)#1 (0)<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528<\/h1>\n\n\n\n<p>\u30af\u30e9\u30b9\u306e\u540d\u524d\u3092\u8868\u3059\u6587\u5b57\u5217\u3092\u30af\u30e9\u30b9\u540d\u306b::class\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u4e00\u65b9\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u306e\u30af\u30e9\u30b9\u540d\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u306f\u3001\u5f93\u6765\u3001get_class()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u3002PHP 8.0\u3067\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u306b::class\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u30af\u30e9\u30b9\u540d\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u30ea\u30b9\u30c84\u306b\u30af\u30e9\u30b9\u540d\u3092\u53c2\u7167\u3059\u308b\u4f8b\u3092\u793a\u3057\u307e\u3059\u3002get_class()\u95a2\u6570\u3092\u7528\u3044\u308b\u5834\u5408\u3068\u52d5\u4f5c\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001\u3088\u308a\u76f4\u611f\u7684\u306b\u30b3\u30fc\u30c9\u304c\u308f\u304b\u308a\u3084\u3059\u304f\u306a\u308b\u52b9\u679c\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ea\u30b9\u30c84 \u30af\u30e9\u30b9\u540d\u53c2\u7167\u306e\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nclass A {}\n$a = new A;\necho A::class;       \/\/ A\necho get_class($a);  \/\/ A\necho $a::class;      \/\/ A<\/code><\/pre>\n\n\n\n<p>\u4eca\u56de\u306f\u3001PHP\n8.0\u306b\u304a\u3051\u308b\u4e3b\u306a\u6a5f\u80fd\u5f37\u5316\u70b9\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002PHP\u81ea\u4f53\u306f\u3059\u3067\u306bPHP\n7\u307e\u3067\u306b\u6210\u719f\u3057\u305f\u74b0\u5883\u3067\u3042\u308b\u305f\u3081\u3001\u8a00\u8a9e\u4ed5\u69d8\u306b\u5927\u304d\u306a\u5909\u66f4\u70b9\u306f\u306a\u304f\u3001\u3055\u3089\u306b\u4f7f\u3044\u3084\u3059\u304f\u3059\u308b\u305f\u3081\u306e\u9032\u5316\u3092\u3068\u3052\u3066\u3044\u308b\u5370\u8c61\u3067\u3059\u3002\u6b21\u56de\u306f\u3001\u305d\u306e\u4ed6\u306e\u5909\u66f4\u70b9\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2020\u5e74\u30822\u304b\u6708\u304c\u904e\u304e\u3001PHP\u306e\u958b\u767a\u306f\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u306e8.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u3093\u3067\u3044\u307e\u3059\u3002\u9806\u8abf\u306b\u958b\u767a\u304c\u9032\u3081\u30702020 ... <a title=\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09\" class=\"read-more\" href=\"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612\" aria-label=\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">Read more<\/a><\/p>\n","protected":false},"author":14,"featured_media":1280,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[15],"tags":[110],"series":[50],"journey":[99],"product":[],"class_list":["post-3612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-technical-guides","series-php-column-hiirokawa","journey-run","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column<\/title>\n<meta name=\"description\" content=\"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column\" \/>\n<meta property=\"og:description\" content=\"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612\" \/>\n<meta property=\"og:site_name\" content=\"KUSANAGI Tech Column\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-01T23:08:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-16T17:10:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"650\" \/>\n\t<meta property=\"og:image:height\" content=\"330\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"\u5ee3\u5ddd\u985e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@kusanagi_saya\" \/>\n<meta name=\"twitter:site\" content=\"@kusanagi_saya\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612\"},\"author\":{\"name\":\"\u5ee3\u5ddd\u985e\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#\\\/schema\\\/person\\\/0b4d206900c4c8029f9255a76bdbf302\"},\"headline\":\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09\",\"datePublished\":\"2020-03-01T23:08:15+00:00\",\"dateModified\":\"2026-02-16T17:10:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612\"},\"wordCount\":98,\"publisher\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/hirokawarui.gif\",\"keywords\":[\"\u6280\u8853\u89e3\u8aac\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612\",\"name\":\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/hirokawarui.gif\",\"datePublished\":\"2020-03-01T23:08:15+00:00\",\"dateModified\":\"2026-02-16T17:10:45+00:00\",\"description\":\"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#primaryimage\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/hirokawarui.gif\",\"contentUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2017\\\/09\\\/hirokawarui.gif\",\"width\":650,\"height\":330},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_3612#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#website\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/\",\"name\":\"KUSANAGI Tech Column\",\"description\":\"\u901f\u3055\u306e\u7406\u7531\u3092\u77e5\u308b\u3002\u5b89\u5168\u306e\u4ed5\u7d44\u307f\u3092\u77e5\u308b\u3002WordPress\u904b\u7528\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u89e3\u304f\u6280\u8853\u30b3\u30e9\u30e0\",\"publisher\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#organization\",\"name\":\"KUSANAGI Tech Column\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/logo-tc.png\",\"contentUrl\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/wp-content\\\/uploads\\\/2024\\\/07\\\/logo-tc.png\",\"width\":716,\"height\":57,\"caption\":\"KUSANAGI Tech Column\"},\"image\":{\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/kusanagi_saya\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/#\\\/schema\\\/person\\\/0b4d206900c4c8029f9255a76bdbf302\",\"name\":\"\u5ee3\u5ddd\u985e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g\",\"caption\":\"\u5ee3\u5ddd\u985e\"},\"description\":\"1996\u5e74\u304b\u3089PHP\u3092\u4f7f\u3044\u59cb\u3081\u3001\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u7ffb\u8a33\u3084\u56fd\u969b\u5316\u306a\u3069\u306e\u6d3b\u52d5\u306b\u643a\u308f\u308b\u3002 PHP\u30e6\u30fc\u30b6\u4f1a\u306e\u8a2d\u7acb\u30e1\u30f3\u30d0\u30fc\u306e\u4e00\u4eba\u3002\u8457\u66f8\u306b\u300cPHP\u5fb9\u5e95\u653b\u7565\u300d(\u30bd\u30d5\u30c8\u30d0\u30f3\u30af\u30d1\u30d6\u30ea\u30c3\u30b7\u30f3\u30b0\u520a)\u306a\u3069\u304c\u3042\u308b\u3002\",\"url\":\"https:\\\/\\\/kusanagi.tokyo\\\/column\\\/archives\\\/column_author\\\/rui-hirokawa\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column","description":"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612","og_locale":"ja_JP","og_type":"article","og_title":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column","og_description":"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002","og_url":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612","og_site_name":"KUSANAGI Tech Column","article_published_time":"2020-03-01T23:08:15+00:00","article_modified_time":"2026-02-16T17:10:45+00:00","og_image":[{"width":650,"height":330,"url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif","type":"image\/gif"}],"author":"\u5ee3\u5ddd\u985e","twitter_card":"summary_large_image","twitter_creator":"@kusanagi_saya","twitter_site":"@kusanagi_saya","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#article","isPartOf":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612"},"author":{"name":"\u5ee3\u5ddd\u985e","@id":"https:\/\/kusanagi.tokyo\/column\/#\/schema\/person\/0b4d206900c4c8029f9255a76bdbf302"},"headline":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09","datePublished":"2020-03-01T23:08:15+00:00","dateModified":"2026-02-16T17:10:45+00:00","mainEntityOfPage":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612"},"wordCount":98,"publisher":{"@id":"https:\/\/kusanagi.tokyo\/column\/#organization"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#primaryimage"},"thumbnailUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif","keywords":["\u6280\u8853\u89e3\u8aac"],"articleSection":["PHP"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612","url":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612","name":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09 - KUSANAGI Tech Column","isPartOf":{"@id":"https:\/\/kusanagi.tokyo\/column\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#primaryimage"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#primaryimage"},"thumbnailUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif","datePublished":"2020-03-01T23:08:15+00:00","dateModified":"2026-02-16T17:10:45+00:00","description":"\u6b21\u671f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f38.0\u306e\u30ea\u30ea\u30fc\u30b9\u306b\u5411\u3051\u305f\u3001PHP\u306e\u958b\u767a\u304c\u9806\u8abf\u306b\u9032\u884c\u4e2d\u3068\u306e\u3053\u3068\u3067\u3059\u3002PHP 8.0\u306e\u7279\u5fb4\u3068\u3057\u3066\u3001JIT(Just-In-Time)\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u3088\u308b\u9ad8\u901f\u5316\u3001Union\u578b\u306e\u5c0e\u5165\u3001static\u578b\u623b\u308a\u5024\u6307\u5b9a\u3001\u5f31\u3044\u30de\u30c3\u30d4\u30f3\u30b0\u3001::class\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u306e\u9069\u7528\u306a\u3069\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u5909\u66f4\u70b9\u306f\u3001PHP\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u3055\u3089\u306b\u4fbf\u5229\u306b\u3057\u3066\u304f\u308c\u308b\u8981\u7d20\u3068\u306a\u308a\u307e\u3059\u3002\u767a\u58f2\u4e88\u5b9a\u306f2020\u5e74\u672b\u3068\u3055\u308c\u3066\u304a\u308a\u3001\u958b\u767a\u8005\u3084\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u95a2\u5fc3\u304c\u96c6\u307e\u3063\u3066\u3044\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kusanagi.tokyo\/column\/archives\/column_3612"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#primaryimage","url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif","contentUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2017\/09\/hirokawarui.gif","width":650,"height":330},{"@type":"BreadcrumbList","@id":"https:\/\/kusanagi.tokyo\/column\/archives\/column_3612#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/kusanagi.tokyo\/column"},{"@type":"ListItem","position":2,"name":"PHP\u306e\u6700\u65b0\u72b6\u6cc1\uff1aPHP 8.0\u958b\u767a\u304c\u9032\u3080\uff08\u7b2c11\u56de\uff09"}]},{"@type":"WebSite","@id":"https:\/\/kusanagi.tokyo\/column\/#website","url":"https:\/\/kusanagi.tokyo\/column\/","name":"KUSANAGI Tech Column","description":"\u901f\u3055\u306e\u7406\u7531\u3092\u77e5\u308b\u3002\u5b89\u5168\u306e\u4ed5\u7d44\u307f\u3092\u77e5\u308b\u3002WordPress\u904b\u7528\u306e\u300c\u306a\u305c\uff1f\u300d\u3092\u89e3\u304f\u6280\u8853\u30b3\u30e9\u30e0","publisher":{"@id":"https:\/\/kusanagi.tokyo\/column\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kusanagi.tokyo\/column\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/kusanagi.tokyo\/column\/#organization","name":"KUSANAGI Tech Column","url":"https:\/\/kusanagi.tokyo\/column\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kusanagi.tokyo\/column\/#\/schema\/logo\/image\/","url":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2024\/07\/logo-tc.png","contentUrl":"https:\/\/kusanagi.tokyo\/column\/wp-content\/uploads\/2024\/07\/logo-tc.png","width":716,"height":57,"caption":"KUSANAGI Tech Column"},"image":{"@id":"https:\/\/kusanagi.tokyo\/column\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/kusanagi_saya"]},{"@type":"Person","@id":"https:\/\/kusanagi.tokyo\/column\/#\/schema\/person\/0b4d206900c4c8029f9255a76bdbf302","name":"\u5ee3\u5ddd\u985e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/88a192cce972e18e227572e6c1236571cd80a13270ed546d34b1aa87a94617dc?s=96&d=mm&r=g","caption":"\u5ee3\u5ddd\u985e"},"description":"1996\u5e74\u304b\u3089PHP\u3092\u4f7f\u3044\u59cb\u3081\u3001\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u7ffb\u8a33\u3084\u56fd\u969b\u5316\u306a\u3069\u306e\u6d3b\u52d5\u306b\u643a\u308f\u308b\u3002 PHP\u30e6\u30fc\u30b6\u4f1a\u306e\u8a2d\u7acb\u30e1\u30f3\u30d0\u30fc\u306e\u4e00\u4eba\u3002\u8457\u66f8\u306b\u300cPHP\u5fb9\u5e95\u653b\u7565\u300d(\u30bd\u30d5\u30c8\u30d0\u30f3\u30af\u30d1\u30d6\u30ea\u30c3\u30b7\u30f3\u30b0\u520a)\u306a\u3069\u304c\u3042\u308b\u3002","url":"https:\/\/kusanagi.tokyo\/column\/archives\/column_author\/rui-hirokawa"}]}},"_links":{"self":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/3612","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=3612"}],"version-history":[{"count":1,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/3612\/revisions"}],"predecessor-version":[{"id":5439,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/posts\/3612\/revisions\/5439"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/media\/1280"}],"wp:attachment":[{"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/media?parent=3612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/categories?post=3612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/tags?post=3612"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/series?post=3612"},{"taxonomy":"journey","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/journey?post=3612"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/kusanagi.tokyo\/column\/wp-json\/wp\/v2\/product?post=3612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}