0

I got this message from the validator of plugins from Envato:

  1. When creating a callable, never use &$this, use $this instead: https://envato.d.pr/uDWuiT

I think he may be wrong with his 'never use'. Are we really NOT SAVING a memory when we are passing an object by reference? Can only clarify on this?

Thank you.

  • P.S. Can anyone add tag 'passing-by-reference' here, as I'm not allowed. – KestutisIT Jan 17 at 19:52
  • No, we really don't need this tag! :) – fuxia Jan 17 at 20:45
  • 3
    Oh, and &$this is PHP 4 syntax. WordPress requires version 5 or 7 in which objects are always passed by reference. – fuxia Jan 17 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.