Why "static $i = sqrt(100)" leads to fatal error ? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 4

Why "static $i = sqrt(100)" leads to fatal error ?

https://code.sololearn.com/w53F1znNL96J/?ref=app

25th Sep 2019, 6:02 PM
UraL
4 Respostas
+ 2
Michael thanx
25th Sep 2019, 7:05 PM
UraL
+ 1
"Like any other PHP static variable, static properties may only be initialized using a literal or constant before PHP 5.6; expressions are not allowed. In PHP 5.6 and later, the same rules apply as const expressions.ā€œ (https://www.php.net/manual/en/language.oop5.static.php)
25th Sep 2019, 6:47 PM
Michael
Michael - avatar
+ 1
AK F Lashari what's it?
2nd Oct 2019, 8:23 PM
UraL
0
03022337110
2nd Oct 2019, 7:23 PM
AK F Lashari
AK F Lashari - avatar