Bug #81631 [Opn->Ver]: ::class with dynamic class name may yield wrong line number
| From: | cmb@php.net | Date: | Wed, 17 Nov 2021 14:22:49 +0000 |
| Subject: | Bug #81631 [Opn->Ver]: ::class with dynamic class name may yield wrong line number | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237816@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81631&edit=1
ID: 81631
Updated by: cmb@php.net
Reported by: shaohua dot li at inf dot ethz dot ch
Summary: ::class with dynamic class name may yield wrong line
number
-Status: Open
+Status: Verified
Type: Bug
Package: Scripting Engine problem
Operating System: Ubuntu 20.04.3 LTS
PHP Version: 8.1Git-2021-11-17 (Git)
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2021-11-17 14:22:43] cmb@php.net
Indeed: <https://3v4l.org/u2PV1>. Line 3 would be
correct.
------------------------------------------------------------------------
[2021-11-17 13:40:11] shaohua dot li at inf dot ethz dot ch
Description:
------------
Hi there,
I compiled php-src with clang13 and gcc11. For the following script,
sapi/cli/php emits
warning message "Warning: Undefined variable $b", but
For clang13 compiled one, the warning says the error happens on line 3.
For gcc11 compiled one, the warning says the error happens on line 2.
Test script:
---------------
<?php
$a = 0;
var_dump($b::class);
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81631&edit=1