python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
What does question mark do in php?
class Service
{
private Logger $logger;
public function __construct(
?Logger $logger = null,
) {
$this->logger = $logger ?? new NullLogger();
}
}
I'm learning php ...
rurumita
Votes: 0
Answers: 2
Upgrade PHP version in project from 5.6 to 8.1
I need to upgrade PHP version of my project. It is PHP5.6 and I want to upgrade it to PHP8.1. I tried to search for such information but couldn't find it, thus, I want to ask. Is it better to upgrade ...
Mr_T
Votes: 0
Answers: 2
Laravel 9: Component constructor default parameters
In the component constructor, I always set the default value for attributes (Laravel v7-8, PHP 7.4).
Version
PHP 8.1.4
Laravel 9.6.0
public $type;
public $message;
public function __construct($type =...
user1910413
Votes: 0
Answers: 1
Migration to PHP 8.1 - how to fix Deprecated Passing null to parameter error - rename build in functions
PHP 8.1 has deprecated passing null as parameters to a lot of core functions. My main problem is with functions like htmlspecialchars(php) and trim(php), where null no longer is silently converted to ...
Janis T
Votes: 0
Answers: 12