Skip to content

After fclose() is_resource() stays true and var_dump still reports a stream (php: false and "resource (closed)") #406

Closed

Description

@blacktrs

Summary

After fclose() is_resource() stays true and var_dump still reports a stream (php: false and "resource (closed)").

Repro

<?php
$f = fopen('php://memory', 'r+');
fclose($f);
var_dump(is_resource($f));
echo gettype($f), "\n";

Expected (php)

bool(false)
resource (closed)

Actual (manticore 57b5de57, Darwin arm64)

bool(true)
resource

Tracking

Known-bug repro: tests/aot/repro/wrong/is_resource_true_after_fclose.php — bash tests/aot/xfail.sh -k is_resource_true_after_fclose reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    wrong-answer
    on Oct 23, 2026
  2. added a commit that references this issue on Oct 23, 2026
    9b8344d
  3. added a commit that references this issue on Oct 24, 2026
    a15ad0f
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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions