May 4, 2018

Programming - Errors

A non-numeric value encountered

Broken:

$userteam->da = '';

$userteam->da + $userteam->da_2 + $userteam->da_3;

Fix:

$userteam->da = 0;
$userteam->da + $userteam->da_2 + $userteam->da_3;

Time Spent: 3 minutes


May 4, 2018

Programming - Errors

[] operator not supported for strings

After my week of broken environments, I get enstars back up and boom this error.

The PHP version of the live version is 5.6 while the new dev environment is 7.2

Old code:

$allcards = '';
 $allcards[] = $card;

Fixed Code

 $allcards = [];
 $allcards[] = $card;

https://stackoverflow.com/questions/5879675/problem-with-fatal-error-operator-not-supported-for-strings-in

Time Spent: 4 minutes