What is null coalescing assignment ??= operator in PHP 7.4

From the docs: Coalesce equal or ??=operator is an assignment operator. If the left parameter is null, assigns the value of the right paramater to the left one. If the value is not null, nothing is done. Example: // The folloving lines are doing the same $this->request->data[‘comments’][‘user_id’] = $this->request->data[‘comments’][‘user_id’] ?? ‘value’; // Instead of repeating … Read more

Message: Trying to access array offset on value of type null [duplicate]

This happens because $cOTLdata is not null but the index ‘char_data’ does not exist. Previous versions of PHP may have been less strict on such mistakes and silently swallowed the error / notice while 7.4 does not do this anymore. To check whether the index exists or not you can use isset(): isset($cOTLdata[‘char_data’]) Which means … Read more

Why I am suddenly getting a “Typed property must not be accessed before initialization” error when introducing properties type hints?

Since PHP 7.4 introduces type-hinting for properties, it is particularly important to provide valid values for all properties, so that all properties have values that match their declared types. A property that has never been assigned doesn’t have a null value, but it is on an undefined state, which will never match any declared type. … Read more

What is the difference between fastcgi and fpm?

FPM is a process manager to manage the FastCGI SAPI (Server API) in PHP. Basically, it replaces the need for something like SpawnFCGI. It spawns the FastCGI children adaptively (meaning launching more if the current load requires it). Otherwise, there’s not much operating difference between it and FastCGI (The request pipeline from start of request … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)