Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using an empty array as default argument for a reference variable causes it to reference directly to the Empty array singleton #591

Closed
calvinbaart opened this issue Nov 22, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@calvinbaart
Copy link
Contributor

Sample:

function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])
{
    $processed []= 10;
}

assertEquals(1, 2);

print_r([]);

PeachPie output:

Array
(
    [0] => 10
)

PHP output:

Array
(
)
@jakubmisek jakubmisek self-assigned this Nov 22, 2019
@jakubmisek jakubmisek added this to the 1.0.0 milestone Nov 22, 2019
jakubmisek added a commit that referenced this issue Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants