title: Execute code when annotated function or property is used in PHP
body: <p>How would I add &quot;functionality&quot; to the <code>@deprecated</code> annotation so that I can execute code before or after (ideally both) execution of a function or when a deprecated property is accessed?</p>
  <p>So I want to use the <code>@deprecated</code> annotation in PHP to do different things independent to the normal behaviour of the called function, so that developers who add the annotation to a deprecated function don't have to add the functionality to the function (e.g. logging details of the call).</p>
  <p>In that way I think it's very usable as a developer and the IDE also recognizes the <code>@deprecated</code> annotation by default and suggests you not to use it.</p>
  <p>I'm running PHP 7.3 if that's important.</p>