Skip to content

ArgumentCountError from $o->__construct(...$args) names the method C8::::construct() instead of C8::__construct() #596

Closed

Description

@blacktrs

Summary

ArgumentCountError from $o->__construct(...$args) names the method C8::::construct() instead of C8::__construct().

Repro

<?php
class C8 { public function __construct(public int $need) {} }
function f(array $args, object $o): void { $o->__construct(...$args); }
try { f([], new C8(1)); } catch (\ArgumentCountError $e) { echo \preg_replace('/\(\).*/', '()', $e->getMessage()), "\n"; }

Expected (php)

Too few arguments to function C8::__construct()

Actual (manticore c3e6998f, Darwin arm64)

Too few arguments to function C8::::construct()

Tracking

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

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