note 106218 deleted from language.types.object by cmb

From: Date: Fri, 15 May 2015 19:11:55 +0000
Subject: note 106218 deleted from language.types.object by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-202544@lists.php.net to get a copy of this message
Note Submitter: razvan_zarzu at yahoo dot com ---- In PHP 5.3.6, even if the following code doesn't have any apparent syntax errors: <?php class Test { public $a = SplFixedArray::fromArray(array()); } ?> , the result is: Parse error: syntax error, unexpected '(', expecting ',' or ';' in ~\test.php on line 3 This is because on an implicit object initialization of $a, which is not allowed in PHP. Hope this helps someone.

« previous php.notes (#202544) next »