4. ã¸ã§ããªã¯ã¹ PHP 8.2 ã§ã¯ãã¸ã§ããªã¯ã¹ã®ãµãã¼ããå°å ¥ããã¾ããã ã¸ã§ããªã¯ã¹ã使ç¨ããã¨ãã³ã¼ãã®åå©ç¨æ§ãåä¸ããåå®å ¨æ§ã確ä¿ããã¾ãã interface Collection<T> { public function add(T $item): void; public function get(int $index): T; } class StringCollection implements Collection<string> { // ... } $stringCollection = new StringCollection(); $stringCollection->add("Hello"); $stringCollection->add(123); // ã¨ã©ã¼ï¼string åãæå¾ ããã¦ãã¾ã ãã®æ³¨éã詳細ãã¼ã¸ã«ã¯ä¸åè¨è¿°ããã¦ããªããã
{{#tags}}- {{label}}
{{/tags}}