Skip to content

An omitted mixed &$v = null argument reads as a non-null junk value instead of null. #415

Closed

Description

@blacktrs

Summary

An omitted mixed &$v = null argument reads as a non-null junk value instead of null.

Repro

<?php
function f(mixed &$v = null) { var_dump($v !== null); var_dump($v); }
f();
class B { function __construct(mixed &$v = null) { var_dump($v !== null); } }
new B;

Expected (php)

bool(false)
NULL
bool(false)

Actual (manticore 668877c0, Darwin arm64)

bool(true)
float(0)
bool(true)

Tracking

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