php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80539 The '#' comment not recognized
Submitted: 2020-12-22 03:05 UTC Modified: 2020-12-22 03:40 UTC
From: funderburkjim at gmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 8.0.0 OS: Windows 10
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: funderburkjim at gmail dot com
New email:
PHP Version: OS:

 

 [2020-12-22 03:05 UTC] funderburkjim at gmail dot com
Description:
------------
Running test script (tempbug.php) gives PHP parse error:

PHP Parse error:  syntax error, unexpected integer "0" in C:\xampp\htdocs\tempbug.php on line 2

This parses and runs without error in php 7.1.9.


Test script:
---------------
<?php
  echo "some message\n";  #[0]
?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-22 03:40 UTC] levim@php.net
-Status: Open +Status: Not a bug
 [2020-12-22 03:40 UTC] levim@php.net
This is because `#[]` is the syntax for attributes in PHP 8.0. Yes, this is a change in behavior from previous versions; easiest thing to do is to change it to `//[0]`.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 11:01:36 2025 UTC