introduce temporary current_ref(), key_ref() and xml_set_object_ref() in preparation for removing references from key(), current() and xml_set_object()
Summary:
key(), current() and xml_set_object() should not be taking reference arguments:
- key() and current() never mutate their argument
- xml_set_object() expects its argument to be an object, and objects have reference semantics by themselves
However, changing reference parameter to a regular parameter is a breaking change, which has to be synchorized between function definition and all callers. It's not realistically possible to fix all affected hack code in lockstep with HHVM release, so I'm proposing the following migration plan instead:
1. introduce temporary key_ref(), current_ref() and xml_set_object() builtins, which behave exactly same way as current(), key() and xml_set_object().
2. wait for a short time to allow hack code to migrate to current_ref(), key_ref(), xml_set_object_ref().
3. change remove references from key(), current(), xml_set_object()
4. wait for a short time to allow hack code to migrate to current(), key(), xml_set_object().
5. remove key_ref(), current_ref() and xml_set_object().
I expect overall migration to take on the order of months, so the migration plan only applies to users, who upgrade regularly.
Reviewed By: billf
Differential Revision:
D16699409
fbshipit-source-id:
1a9630566072f63ed47b42df27e5de2cbe1d74f7