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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 23:01:32 2024 UTC