Skip to content

Inconsistent resource loading when opcache enabled #16442

@jnvsor

Description

@jnvsor

Description

When opcache is enabled successive page loads will not have the script loaded as a resource - I was told this is probably a bug.

This script:

<?php

var_dump(get_resources());

Results in this output on the first load:

array(1) { [1]=> resource(1) of type (stream) } 

And this on the second:

array(0) { } 

The resource will be back in the list on the first request after the file is changed.

Docker build for easy repro:

FROM php:8.4.0RC2-apache-bullseye

RUN docker-php-ext-install opcache
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

PHP Version

8.4-rc2

Operating System

No response

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