Skip to content

new $cls(...$args) with an int element bound to a string constructor parameter segfaults instead of coercing it #253

Closed

Description

@blacktrs

Summary

new $cls(...$args) with an int element bound to a string constructor parameter segfaults instead of coercing it.

Repro

<?php
class U { public function __construct(public string $a = 'x', public int $b = 1) {} }
function mk(string $c, array $args) { return new $c(...$args); }
$o = mk('U', [1, 2]);
var_dump($o->a, $o->b);

Expected (php)

string(1) "1"
int(2)

Actual (manticore 27a5b413, Darwin arm64)


[exit code 139 — SIGSEGV]

Tracking

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