Skip to content

array_shift / array_pop of an emptied int list answer int(0) instead of NULL #312

Closed

Description

@blacktrs

Summary

array_shift / array_pop of an emptied int list answer int(0) instead of NULL.

Repro

<?php
$a = [1];
array_shift($a);
var_dump(array_shift($a));
$b = [2];
array_pop($b);
var_dump(array_pop($b));

Expected (php)

NULL
NULL

Actual (manticore 6df3b897, Darwin arm64)

int(0)
int(0)

Tracking

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