php / php/doc-en

Undocumented changes for get_class_vars and get_parent_class in migration manual to PHP8.0

Open
#1,175 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Migration manual from PHP7.4.x to PHP8.0 forgets to write change about the return value of get_class_vars and get_parent_class.
These functions return false if an invalid class name is given in PHP7.4 or prior, but they throw TypeError in PHP8.0.

7.4: https://github.com/php/php-src/blob/PHP-7.4.27/Zend/tests/get_class_vars_001.phpt
8.0: https://github.com/php/php-src/blob/PHP-8.0/Zend/tests/get_class_vars_001.phpt#L40

This problem exists in all languages.

Note:
This change is only written in the section of get_parent_class document.
I think this change should be written in get_class_vars.

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

Compare the PHP 7.4 and 8.0 get_class_vars tests linked in the issue, then locate the PHP 7.4-to-8.0 migration section for get_class_vars; use the existing get_parent_class entry as a reference. Done means the migration manual records that invalid class names changed from returning false to throwing TypeError for get_class_vars.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.