Skip to content

A fresh local string assigned to a mixed &$out parameter is freed when the function returns. #233

Closed

Description

@blacktrs

Summary

A fresh local string assigned to a mixed &$out parameter is freed when the function returns.

Repro

<?php
function mk(): string { return str_repeat('a', 1074) . (string)mt_rand(1, 1); }
function fill(mixed &$output): bool {
    $pem = mk();
    $output = $pem;
    return true;
}
fill($a);
echo strlen($a), "\n";

Expected (php)

1075

Actual (manticore 0f7be997, Darwin arm64)


[exit code 133]

Tracking

Known-bug repro: tests/aot/repro/crash/byref_mixed_out_fresh_string.php — bash tests/aot/xfail.sh -k byref_mixed_out_fresh_string 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
    crash
    on Oct 13, 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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions