-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Description
Description
I have a large multi-megabyte JSON that is currently parsed several times per second, I also have OPCache enabled, would save time if the parsing could be done at compile-time rather than runtime, would be nice if i could do something like
$data = compile_time_routine(function() {
return json_decode(file_get_contents("large.json"), true);
});instead of
$data = json_decode(file_get_contents("large.json"), true);with it being equivalent at runtime to
$data = array(...whatever json_decode returned...);
another example would be
echo "opcache compiled at " . compile_time_routine(function(){return date(DateTime::RFC3339);});
being equivalent at runtime to
echo "opcache compiled at " . "2023-03-16T09:43:00+01:00";
(i did not give the function name/argument/details much thought fwiw)
Reactions are currently unavailable