Skip to content

Inconsistent outputs with fork in JIT #16410

@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
$pid = pcntl_fork();
var_dump(pcntl_getcpu());
print("1\n");
class A {
    private function __call($strMethod, $arrArgs) {
        echo "In " . __METHOD__ . $strMethod . "(array(" . implode(',',$arrArgs) . "))\n";
    }
}
class B extends A {
    function test() {
        A::test1(1,'a');
    }
}
$b = new B();
$b->test();
?>

Resulted in this output:

int(%d)
1
int(%d)
1
In A::__calltest1(array(1,a))
In A::__calltest1(array(1,a))

But I expected this output instead:

int(%d)
1
In A::__calltest1(array(1,a))
int(%d)
1
In A::__calltest1(array(1,a))

To reproduce:

-d "zend_extension=/php-src/modules/opcache.so" -d "opcache.enable=1" -d "opcache.enable_cli=1" -d "opcache.jit=0115"

Not sure whether it is an expected feature? Also unsure about its impact.

PHP Version

nightly

Operating System

ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions