Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

New in initializers - PHP 8.1

class Service
{
    private Logger $logger;
   
    public function __construct(
        Logger $logger = new NullLogger(),
    ) {
        $this->logger = $logger;
    }
}
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #New #initializers #PHP
ADD COMMENT
Topic
Name
8+8 =