Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass1 statically binds constants at compile time in namespace #17865

Open
bwoebi opened this issue Feb 19, 2025 · 0 comments
Open

Pass1 statically binds constants at compile time in namespace #17865

bwoebi opened this issue Feb 19, 2025 · 0 comments

Comments

@bwoebi
Copy link
Member

bwoebi commented Feb 19, 2025

Description

The following trivial variation of test ext/opcache/tests/bug66251.phpt, ran with opcache:

<?php
namespace X;
printf ("A=%s\n", getA());
const A="hello";
function getA() {return A;}

Resulted in this output:

A=hello

But I expected this output instead:

Fatal error: Uncaught Error: Undefined constant "X\A" in %s:5
Stack trace:
#0 %s(2): X\getA()
#1 {main}
  thrown in %s on line 5

Apparently c2c78dc has changed it from checking from generic DO_FCALL to only ICALL, which made this test pass, but only in the specific tested scenario.

PHP Version

PHP 8.4

Operating System

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant