Hi all,
Getting this error while trying to create a constant inside an object:
php Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}'
the object is being called from another file:
Code in the main file:
include_once ('securimage.php');
$secureimage = new Securimage();
The file is there, named exactly that.
The Securimage() object, in the securimage.php is:
class Securimage
{
// All of the public variables below are securimage options
// They can be passed as an array to the Securimage constructor, set below,
// or set from securimage_show.php and securimage_play.php
/**
* Renders captcha as a JPEG image
* @var int
*/
const SI_IMAGE_JPEG = 1; <----
/**
* Renders captcha as a PNG image (default)
* @var int
*/
const SI_IMAGE_PNG = 2;
and continues.
The line with the arrow is the line the error is occuring on according to php.
I know that I'm in the right file because if I comment out that line, then the same error occurs on the next constant:
const SI_IMAGE_PNG = 2;
I'm running PHP version 5.2.17.
Why would I be getting this error?