Skip to content

var_dump prints #1 for every object and spl_object_id answers an address; php numbers object handles 1, 2, 3. #457

Closed

Description

@blacktrs

Summary

var_dump prints #1 for every object and spl_object_id answers an address; php numbers object handles 1, 2, 3.

Repro

<?php
$a = new stdClass();
$b = new stdClass();
echo spl_object_id($a), " ", spl_object_id($b), "\n";
var_dump($a, $b);

Expected (php)

1 2
object(stdClass)#1 (0) {
}
object(stdClass)#2 (0) {
}

Actual (manticore 7c330c5a, Darwin arm64)

4310356904 4310356936
object(stdClass)#1 (0) {
}
object(stdClass)#1 (0) {
}

Tracking

Known-bug repro: tests/aot/repro/wrong/object_handle_numbers.php — bash tests/aot/xfail.sh -k object_handle_numbers 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 25, 2026
  2. added
    needs-design
    on Nov 2, 2026
  3. blacktrs commented on Nov 9, 2026

    @blacktrs
    ContributorAuthor

    Fixed by #555 (object handles, ABI v25). Checked on the 0.18.0 branch (#605): spl_object_id of two fresh objects answers 1 2, var_dump prints #1 / #2, and a freed id is reused (1 after unset), as in php. #555 listed this issue in a comma-separated Fixes line, which closes only the first number.

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

    bugneeds-designwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions