0

I don't know php, but this script is old and supposedly works I get this error: Backend fatal error: PHP Parse error: syntax error, unexpected '?' i

from this line

if (is_string($arguments[0])) {
            return app('cache')->get($arguments[0], $arguments[1] **??** null);
        }

Is something missing or wrong with the ??

Russ
  • 11
  • 2
  • What shall `**??**` be? Before null a comma is missing. – Markus Zeller Jun 13 '20 at 20:28
  • Those are bold tags for this editor – Russ Jun 13 '20 at 20:33
  • so replace ?? with comma? – Russ Jun 13 '20 at 20:34
  • Ah, you mean a null coalesce operator. `return app('cache')->get($arguments[0], $arguments[1] ?? null);` working only since php v7.0. Before 7.0 you need to do it manually like `return app('cache')->get($arguments[0], empty($arguments[1]) ? null : $arguments[1]);` – Markus Zeller Jun 13 '20 at 20:40
  • I just changed php to v7.0 and got this error Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_PARSE) Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) – Russ Jun 13 '20 at 20:40
  • I'm seeing this ?? null, sprinkled throughout the php files – Russ Jun 13 '20 at 21:07
  • Are you sure the PHP 7.0 upgrade is finalized? Did you restart the apache service afterwards? – Markus Zeller Jun 13 '20 at 21:17

0 Answers0