Skip to content

A 3-level nested write under an array whose elements are all strings throws "Cannot access offset of type string on string". #237

Closed

Description

@blacktrs

Summary

A 3-level nested write under an array whose elements are all strings throws "Cannot access offset of type string on string".

Repro

<?php
$p = ["k.dir" => "x"];
$p["m"]["F"]["n"] = "v";
print_r($p);

Expected (php)

Array
(
    [k.dir] => x
    [m] => Array
        (
            [F] => Array
                (
                    [n] => v
                )

        )

)

Actual (manticore bc82c16e, Darwin arm64)


[exit code 255]
PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string

Tracking

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