# RFC: Deprecations for PHP 8.7

- Status: Draft
- Authors: Daniel Scherzer daniel.e.scherzer@gmail.com
- Date: 2026-08-12
- Original: https://wiki.php.net/rfc/deprecations_php_8_7
- Page: https://externals.io/rfc/deprecations_php_8_7
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

## Discussions on the mailing list

- [Deprecate b-prefix for strings](https://externals.io/message/132634.md) — started on 2026-09-25, 7 messages

---

## Introduction

The RFC proposes to deprecate the listed functionality in PHP 8.7 and remove it in PHP 9 (except where otherwise noted).

The following list provides a short overview of the functionality targeted for deprecation, while more detailed explanation is provided in the Proposal section:

- Deprecate `is_a` with $object\_or\_class not being a string or object
- Deprecate `is_subclass_of` with $object\_or\_class not being a string or object
- Deprecate the b prefix for binary strings

## Proposals

Each feature proposed for deprecation is voted separately and requires a 2/3 majority. All votes refer to deprecation in PHP 8.7 and removal in PHP 9 (except where otherwise noted).

### Example Deprecation

- Author: Name <name@example.com>

Description

### Deprecate is\_a() with $object\_or\_class not being a string or object

- Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>

`is_a` is used to check if an object or class name is an instance of some other named class/interface. The first parameter can be either an object to check, or the name of a class. It can also be something other than a string or object, in which case the function will always return false. I.e. code like `is_a(5, "int")` or `is_a(true, "bool")` will always return false.

Given that `is_a` always returns false when the first parameter is something other than a string or object, we propose to deprecate providing non-string non-object parameters. If the type of a parameter is not known, the `is_a` call can be preceded with a call to `is_object`.

If accepted, calling `is_a` with non-string non-object parameters will emit a deprecation similar to the following:

> Deprecated: Calling is\_a() with $object\_or\_class of type %s is deprecated.

### Deprecate is\_subclass\_of() with $object\_or\_class not being a string or object

- Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>

`is_subclass_of` is used to check if an object or class name is an instance of a subclass of some other named class, or an instance of an interface. It works similarly to `is_a`, except when an object's class is the exact same as the class to check. Like `is_a`, the first parameter can be either an object to check, or the name of a class. It can also be something other than a string or object, in which case the function will always return false. I.e. code like `is_subclass_of(5, "int")` or `is_subclass_of(true, "bool")` will always return false.

Given that `is_subclass_of` always returns false when the first parameter is something other than a string or object, we propose to deprecate providing non-string non-object parameters. If the type of a parameter is not known, the `is_subclass_of` call can be preceded with a call to `is_object`.

Unlike `is_a`, `is_subclass_of` also semantically makes no sense for non objects (or string class names) because there is no subclassing concept for non-objects.

If accepted, calling `is_subclass_of` with non-string non-object parameters will emit a deprecation similar to the following:

> Deprecated: Calling is\_subclass\_of() with $object\_or\_class of type %s is deprecated.

### Deprecate the b prefix for binary strings

- Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
- Juliette Reinders Folmer [php-internals\_nospam@adviesenzo.nl](mailto:php-internals_nospam@adviesenzo.nl)

TODO <https://news-web.php.net/php.internals/132634>
