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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: willirl at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC