Bug #81046 [Fbk->Opn]: constant overwrite class method
| From: | cmb@php.net | Date: | Mon, 17 May 2021 12:25:02 +0000 |
| Subject: | Bug #81046 [Fbk->Opn]: constant overwrite class method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-233863@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: Feedback
+Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: Linux
PHP Version: 8.0.6
-Assigned To: cmb
+Assigned To:
Block user comment: N
Private report: N
New Comment:
Thanks for the further information. This might be an OPcache
issue.
Previous Comments:
------------------------------------------------------------------------
[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