1

I have this problem while deploying my laravel project online o dont know why it shows

03-Sep-2022 23:43:55 Asia/Manila] PHP Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /home/eksperto/ekspertofiles/vendor/nunomaduro/termwind/src/Functions.php on line 17

I even tried to delete that line but nothing happens im new to this can someone help me thanks

  • Im currently using php 8.1 but the php version on my server is 7.4 – Mabbun Samuell Dave Yanga Sep 03 '22 at 16:21
  • Thats your problem probably. In termwid composer json you have `"require": { "php": "^8.0",` – Uwe Sep 03 '22 at 16:55
  • 1
    I don't know which *version* of Termwind you're using, but line 17 of Functions.php for [the current version](https://github.com/nunomaduro/termwind/blob/master/src/Functions.php#L17) uses a union type declaration for the function arguments. This syntax was introduced in PHP 8.0. Note that PHP 7.4 is end-of-life [in two months](https://www.php.net/supported-versions.php), so you should probably update your server to use PHP 8.0 at minimum (which reaches end-of-support in two months) or preferably PHP 8.1. – rickdenhaan Sep 03 '22 at 17:12

1 Answers1

0

Type unions were introduced with PHP 8 - see Is it possible to type hint more than one type?

The line uses that apparently.

function renderUsing(OutputInterface|null $renderer): void
Uwe
  • 385
  • 1
  • 5
  • 14