Skip to content

A local that is statically null and used as an array key is key 0 instead of "" #412

Closed

Description

@blacktrs

Summary

A local that is statically null and used as an array key is key 0 instead of "".

Repro

<?php
$a = [];
$n = null;
$a[$n] = 'x';
var_dump(array_keys($a));

Expected (php)

array(1) {
  [0]=>
  string(0) ""
}

Actual (manticore b8778dbc, Darwin arm64)

array(1) {
  [0]=>
  int(0)
}

Tracking

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

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