Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: Why ERROR constant produces error?

Tags:

php

constants

I am using following code:

define ('EMPTY', 'test');
echo EMPTY;

But I am unable to get output. I am getting following Error:

Parse error: syntax error, unexpected ';', expecting '('
like image 921
Maria Avatar asked May 06 '26 02:05

Maria


1 Answers

Empty is a reserved word.

<?php

define ('EMPTY2', 'test');
echo EMPTY2;

Works as intended.

like image 180
Niclas Larsson Avatar answered May 08 '26 16:05

Niclas Larsson