Bug #81046 [Com]: constant overwrite class method

From: Date: Mon, 17 May 2021 12:34:18 +0000
Subject: Bug #81046 [Com]: constant overwrite class method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233864@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 Comment by: felix at felix-kolbe dot de Reported by: felix at felix-kolbe dot de Summary: constant overwrite class method Status: Open Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 8.0.6 Block user comment: N Private report: N New Comment: OK, switching off OPCache prevents the error. Previous Comments: ------------------------------------------------------------------------ [2021-05-17 12:25:02] cmb@php.net Thanks for the further information. This might be an OPcache issue. ------------------------------------------------------------------------ [2021-05-17 12:23:25] felix at felix-kolbe dot de as eval its work also but as script in Apache Environment(CGI) its produce the error as described above ------------------------------------------------------------------------ [2021-05-17 12:15:02] felix at felix-kolbe dot de OK on bash its work, But not in Apache https://www.file-upload.net/download-14586850/PHP8.0.5-phpinfo.pdf.html php -m [PHP Modules] Core ctype curl date dom filter gd gmp hash iconv json libxml mbstring mysqli mysqlnd openssl pcntl pcre PDO pdo_mysql pdo_sqlite Phar Reflection session SimpleXML sockets SPL sqlite3 standard tokenizer xml xmlreader xmlwriter Zend OPcache zip zlib [Zend Modules] Zend OPcache ------------------------------------------------------------------------ [2021-05-17 11:56:57] cmb@php.net I cannot reproduce[1]. Is there some "special" extension involved? [1] <https://3v4l.org/JuaDl> ------------------------------------------------------------------------ [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 (#233864) next »