Skip to content

A named argument in a method call on a nullable-object receiver binds by position instead of by name #499

Closed

Description

@blacktrs

Summary

A named argument in a method call on a nullable-object receiver binds by position instead of by name.

Repro

<?php
class AB {
    public function with($a = 'A', $b = 'B', $c = 'C') { echo "a=$a b=$b c=$c\n"; return $this; }
}
function mk($x) { return $x ? new AB : null; }
mk(true)->with(c: 'cc');
$o = mk(true);
$o->with(b: 'bb');

Expected (php)

a=A b=B c=cc
a=A b=bb c=C

Actual (manticore 7281fb55, Darwin arm64)

a=cc b=B c=C
a=bb b=B c=C

Tracking

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