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.

3
  • P.S. Can anyone add tag 'passing-by-reference' here, as I'm not allowed.
    – KestutisIT
    Commented Jan 17, 2019 at 19:52
  • No, we really don't need this tag! :)
    – fuxia
    Commented Jan 17, 2019 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
    Commented Jan 17, 2019 at 20:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.