Skip to content

Stdlib: stream_resolve_include_path() — include_path filename resolution missing (ext/standard/streams.c) #6051

Description

@PurHur

Category

stdlib | bootstrap

Problem

Zend exposes stream_resolve_include_path(string $filename): string|false to locate a file against the active include_path stack. This compiler reports function_exists('stream_resolve_include_path') → false, yet ext/standard/VmMetaTags.php already calls it — autoload/meta flows cannot resolve relative includes the way php-src does.

Distinct from #3223 (get_include_path / set_include_path stack); this issue is the lookup builtin itself.

php-src reference

Repro

./script/docker-exec.sh -- php bin/vm.php -r '
echo function_exists("stream_resolve_include_path") ? "yes" : "no", PHP_EOL;
set_include_path("/tmp");
var_export(stream_resolve_include_path("missing.php"));
'

Observed:

no
Call to undefined function stream_resolve_include_path()

Zend PHP expected: yes; returns absolute path when found, false when not.

Scope (this repo)

Done when

  • function_exists('stream_resolve_include_path') → true
  • With set_include_path('…'), resolves existing file to absolute path; missing file → false
  • Enum case $filename → TypeError (php-src-strict)
  • VmMetaTags path no longer calls undefined builtin
  • test/compliance/cases/stdlib/stream_resolve_include_path.phpt green on VM
  • ./script/docker-exec.sh -- vendor/bin/phpunit --filter StreamResolveIncludePath

Links

Activity

  1. added
    enhancementNew feature or request
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jun 5, 2026
  2. PurHur commented on Jun 8, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib — starting this run

  3. PurHur commented on Jun 8, 2026

    @PurHur
    OwnerAuthor

    Merged via #7690.

    Verification (Docker):

    • vendor/bin/phpunit test/unit/StreamResolveIncludePathTest.php — OK (3 tests)
    • vendor/bin/phpunit --filter stream_resolve_include_path — OK (4 tests: VM + JIT compliance)
    • function_exists('stream_resolve_include_path') → true on bin/vm.php

    Implementation: ext/standard/VmIncludePath.php, VmFs::resolveIncludePath(), builtins + lib/JIT/Builtin/IncludePathRuntime.php for JIT/AOT. VmMetaTags now uses VmFs::resolveIncludePath() directly.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machineenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevExphase-4:stdlibPhase 4 – stdlib for web apps

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions