1--TEST-- 2#[\Deprecated]: Functions and Methods. 3--FILE-- 4<?php 5 6#[\Deprecated] 7function test() { 8} 9 10#[\Deprecated("use test() instead")] 11function test2() { 12} 13 14class Clazz { 15 #[\Deprecated] 16 function test() { 17 } 18 19 #[\Deprecated("use test() instead")] 20 function test2() { 21 } 22} 23 24$closure = #[\Deprecated] function() { 25}; 26 27$closure2 = #[\Deprecated] function() { 28}; 29 30class Constructor { 31 #[\Deprecated] 32 public function __construct() { 33 } 34 35 #[\Deprecated] 36 public function __destruct() { 37 } 38} 39 40test(); 41test2(); 42call_user_func("test"); 43 44$cls = new Clazz(); 45$cls->test(); 46$cls->test2(); 47 48call_user_func([$cls, "test"]); 49 50$closure(); 51 52$closure2(); 53 54new Constructor(); 55 56?> 57--EXPECTF-- 58Deprecated: Function test() is deprecated in %s 59 60Deprecated: Function test2() is deprecated, use test() instead in %s on line %d 61 62Deprecated: Function test() is deprecated in %s on line %d 63 64Deprecated: Method Clazz::test() is deprecated in %s 65 66Deprecated: Method Clazz::test2() is deprecated, use test() instead in %s 67 68Deprecated: Method Clazz::test() is deprecated in %s 69 70Deprecated: Function {closure:%s:%d}() is deprecated in %s on line %d 71 72Deprecated: Function {closure:%s:%d}() is deprecated in %s on line %d 73 74Deprecated: Method Constructor::__construct() is deprecated in %s on line %d 75 76Deprecated: Method Constructor::__destruct() is deprecated in %s on line %d 77