1
I’m getting the following error in my code, and I’m not getting the reason why.
Got error 'PHP message: PHP Warning: Constants may only evaluate to scalar values in config.php on line 85
On the lines 81 to 85 I have the following:
define("DATA_CONFIG",[
"master_id" => $dados_config->sistema_master_id,
"sis_url" => $dados_config->sistema_url,
"api_key" => base64_decode($dados_config->sistema_key)
]);
In the 85 I have the closing, but in the 84 I have the following line, there is some problem to use the base64_decode
in a constant? Or making this conversion where I am doing may cause some problem?
"api_key" => base64_decode($dados_config->sistema_key)
In PHP up to 5.6 constants cannot contain arrays.
– bfavaretto
I’m wearing a 7.2
– Helison Santos Cruz
Are you sure? In this version this error message should not appear.
– bfavaretto