php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50656 Assign constant to var causes syntax error
Submitted: 2010-01-04 15:07 UTC Modified: 2010-01-04 15:15 UTC
From: willirl at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.1 OS: mac os x 10.6
Private report: No CVE-ID: None
 [2010-01-04 15:07 UTC] willirl at gmail dot com
Description:
------------
This error is on Mac 10.6 has PHP 5.3.0 which is not shown in version selector.

The code causes this error:

Parse error: syntax error, unexpected T_VAR in /Users/willirl/Desktop/TEST Files/test.php on line 6

Reproduce code:
---------------
<?php

define('A_CONSTANT', 25);


var $abc = A_CONSTANT;

?>

Expected result:
----------------
No error.  $abc set to 25.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-04 15:15 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Drop the \"var\" keyword.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 13:01:36 2024 UTC