Cannot concatenate or do other basic (arithmetical) operations on constants while defining class constants (but only inside of arrays).
Code:
<?php
class a
{
private const SENSITIVE_HEADERS = ['a'.'b'];
}
Result:
[daniil@daniil-arch jav]$ jppm start
-> linux
-> app:run
-> install
Fatal error: Uncaught Error: Expecting constant value for a::SENSITIVE_HEADERS in res://t.php on line 4, position 13
Stack Trace:
#0 {main}
thrown in res://t.php on line 4
If using the value directly (private const SENSITIVE_HEADERS = 'a'.'b';, without the array) everything works fine.
Cannot concatenate or do other basic (arithmetical) operations on constants while defining class constants (but only inside of arrays).
Code:
Result:
If using the value directly (
private const SENSITIVE_HEADERS = 'a'.'b';
, without the array) everything works fine.