WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #46635, comment 6


Ignore:
Timestamp:
04/03/2019 05:51:52 AM (10 months ago)
Author:
giuseppe.mazzapica
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #46635, comment 6

    initial v1  
    1 Yes, signatures are "fragile". Using the declaring file as identifier `some-file.php/function()`, like would be more stable: the fact that a closure is moved from a file to another can not be assumed to be more frequent than a function that changes name.
     1Yes, signatures are "fragile". Using the declaring file as identifier `some-file.php/function()`, would be more stable: the fact that a closure is moved from a file to another can not be assumed to be more frequent than a function that changes name.
    22
    33However, that would require Reflections which means that to store the serialization upfront would be a potentially big waste of resources having to serialize ''any'' closure, even if chances are high none will be removed. On the other hand, not storing upfront means that removing will be quite expensive having to loop the potential dozen of callbacks added to a given hook, and using Reflection anytime a closure is encountered.