|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-09-19 17:20 UTC] Wes dot example at example dot org
[2018-09-19 17:22 UTC] Wes dot example at example dot org
[2018-09-20 12:52 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2018-09-20 12:52 UTC] cmb@php.net
[2018-10-07 09:38 UTC] cmb@php.net
-Status: Feedback
+Status: No Feedback
[2018-10-07 09:38 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 07:00:01 2025 UTC |
Description: ------------ Closure::apply — Binds and calls the closure with an array of parameters #Description ``` public mixed Closure::apply ( object $newthis [, array $param_arr ] ) ``` Temporarily binds the closure to newthis, and calls it with any given array of parameters. #Parameters newthis The object to bind the closure to for the duration of the call. param_arr The parameters to be passed to the callback, as an indexed array. #Return Values Returns the return value of the closure. Test script: --------------- $closure = function($name, $age) { return $name . ' is ' . $age . ' years old'; } $closure->apply($three, ['Peter', 30]); Expected result: ---------------- Peter is 30 years old