php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80475 JIT - "Undefined variable" errors
Submitted: 2020-12-03 05:03 UTC Modified: 2020-12-27 04:22 UTC
From: herbert at groot dot jebbink dot nl Assigned:
Status: No Feedback Package: JIT
PHP Version: 8.0.0 OS: Linux Debian (crostini)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
45 - 15 = ?
Subscribe to this entry?

 
 [2020-12-03 05:03 UTC] herbert at groot dot jebbink dot nl
Description:
------------
I have with JIT "Undefined variable" errors in a big application that does not give this error without JIT, 

It happens when there is a global statement of a variable that does not exists, but if I use this construction in a small example script then it works with JIT

./configure --with-apxs2=/usr/bin/apxs2 --with-mysql-sock=/run/mysqld/mysqld.sock --enable-mbstring --enable-exif --enable-ftp --with-zip --enable-soap --with-mysqli --with-pdo-mysql --with-curl --with-openssl --with-zlib --with-bz2 --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-tidy --with-xsl --with-sodium --enable-shmop --with-pspell --with-pear

memory_limit = 2048M
display_errors = on
error_reporting = E_ALL
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=128M
extension=memcached.so
extension=yaml.so
zend_extension=xdebug.so
xdebug.mode=debug


Test script:
---------------
<?php

  myFunc ('abc');
  myFunc ('xyz');

  function myFunc ($index) {

    global $myVar;
    
    $myVar [$index] = TRUE;

  }

?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-03 10:58 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: JIT
 [2020-12-14 13:04 UTC] dmitry@php.net
-Status: Open +Status: Feedback
 [2020-12-14 13:04 UTC] dmitry@php.net
Do you see the same problem without xdebug? (this may be some xdebug/JIT incompatibility).

We need a reproduction case to understand and fix this.
 [2020-12-27 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 14:01:33 2024 UTC