Jump to content

PHP Error - unparenthesized issue


Gazzieh
Go to solution Solved by maxxd,

Recommended Posts

I have received a plugin for a system (Moodle) and, on install, get the following error in the error logs:

Quote

[Sat Sep 04 15:54:28.583053 2021] [php:error] [pid 15584] [client 5.153.65.228:36044] PHP Fatal error:  Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in /var/www/html/moodle/blocks/mis_integrator/lib/url.php on line 19

The offending line of code is:

$s = empty($_SERVER["HTTPS"]) ? ''
    		: ($_SERVER["HTTPS"] == "on") ? "s"
    		: "";

I haven't coded in PHP for a while now and have just updated the server to PHP 8.0

I cannot see what is wrong in this section; anyone have an idea?

Link to comment
Share on other sites

  • 1 year later...

Upgrade virsion 7 to 8.2

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 116

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 118

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 120

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 126

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 128

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\xampp\phpMyAdmin\vendor\phpmyadmin\motranslator\src\Loader.php on line 130

Fatal error: Unparenthesized `a ? b : c ? d : e` is not supported. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in C:\xampp\phpMyAdmin\libraries\DatabaseInterface.php on line 518

Thank you

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.