Skip to content
github-actions[bot] edited this page Oct 14, 2026 · 2 revisions

Executes a callback within a controlled scope, ensuring resources are released at the end.

This function MUST create a Defer instance, pass it to the factory, and execute the callback. The Defer instance SHALL be unset after execution.


  • Full name: using
  • Defined in: functions.php

Parameters

Parameter Type Description
$factory callable a function that receives the Defer and returns the resource
$callback callable a function that receives the resource and executes the desired logic

Return Value

mixed

the return value of the callback

Clone this wiki locally