php / php/doc-en

SplFixedArray::valid() is unavailable

Open
#4,575 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Extension: spl Status: Needs Triage
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Description

The following code:

<?php
(new SplFixedArray(0))->valid();

Resulted in this output:

    Fatal error: Uncaught Error: Call to undefined method SplFixedArray::valid() in /in/9mO1i:2
    Stack trace:
    #0 {main}
      thrown in /in/9mO1i on line 2

    Process exited with code 255.

But I expected this output instead:

(blank)

I don't see any notice about SplFixedArray::valid being deprecated/removed in the documentation, and there's no mention of it in the PHP8.0.0 changelog https://www.php.net/ChangeLog-8.php either,

but it has been unavailable since PHP8.0.0.

PHP Version

PHP8.4.5

Operating System

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SplFixedArray documentation entry and the PHP 8.0 changelog mentioned in the report. Verify how valid() became unavailable and document that change in the appropriate reference or changelog location; done when readers are warned about its PHP 8.0+ availability.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.