Bug #81046 [Opn->Fbk]: constant overwrite class method

From: Date: Mon, 17 May 2021 11:56:57 +0000
Subject: Bug #81046 [Opn->Fbk]: constant overwrite class method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233860@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81046&edit=1 ID: 81046 Updated by: cmb@php.net Reported by: felix at felix-kolbe dot de Summary: constant overwrite class method -Status: Open +Status: Feedback Type: Bug -Package: Class/Object related +Package: Scripting Engine problem Operating System: Linux PHP Version: 8.0.6 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: I cannot reproduce[1]. Is there some "special" extension involved? [1] <https://3v4l.org/JuaDl> Previous Comments: ------------------------------------------------------------------------ [2021-05-17 11:39:18] felix at felix-kolbe dot de Description: ------------ testet with 8.0.3 and 8.0.5 using a constant with upper-case(sic!) and the same name as a method result in "Call to undefined method" (and vice versa method overwrite constants) Test script: --------------- <?php const fuN = 1; new test; class test{ public function __construct() { fuN; $this->fun(); // prints test->fun $this->fuN(); //Call to undefined method test::fuN() //fuN; coment this out for : Uncaught Error: Undefined constant "fuN" } function fun(){ echo "<p>" . __CLASS__ . "->" . __FUNCTION__ . "</p>"; } } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81046&edit=1

« previous php.bugs (#233860) next »