Skip to content

get_defined_vars() is undefined: it traps with "Call to undefined function" instead of returning the local scope. #264

Closed

Description

@blacktrs

Summary

get_defined_vars() is undefined: it traps with "Call to undefined function" instead of returning the local scope.

Repro

<?php
function dv(int $p) { $a = 1; $b = 'x'; unset($a); $c = [1]; return get_defined_vars(); }
echo json_encode(dv(7)), "\n";

Expected (php)

{"p":7,"b":"x","c":[1]}

Actual (manticore b6110020, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught Error: Call to undefined function get_defined_vars()

Tracking

Known-bug repro: tests/aot/repro/wrong/get_defined_vars_missing.php — bash tests/aot/xfail.sh -k get_defined_vars_missing 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 15, 2026
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