Adopt #[Deprecated] attribute

Created on 8 October 2024, 4 months ago

Problem/Motivation

PHP now shipping #[Deprecated] native attribute - see RFC

Example

#[\Deprecated("use test() instead", since: "11.0")]
function test4() {
}

Steps to reproduce

# php -v
PHP 8.4.0RC1 (cli) (built: Sep 25 2024 10:17:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.0RC1, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.0RC1, Copyright (c), by Zend Technologies

# php --rc Deprecated
Class [ <internal:Core> final class Deprecated ] {

  - Constants [0] {
  }

  - Static properties [0] {
  }

  - Static methods [0] {
  }

  - Properties [2] {
    Property [ public protected(set) readonly ?string $message ]
    Property [ public protected(set) readonly ?string $since ]
  }

  - Methods [1] {
    Method [ <internal:Core, ctor> public method __construct ] {

      - Parameters [2] {
        Parameter #0 [ <optional> ?string $message = null ]
        Parameter #1 [ <optional> ?string $since = null ]
      }
    }
  }
}

Proposed resolution

Discuss it's usage and start use it instead of doc-blocks

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024