Siemens Simatic WinCC 7 0 SP3 32bit 64bit


Category:SCADA software
Category:Industrial automation software
Category:Embedded systems:107E000001C0B7C0112484B790E89093610010922C



passing in a function via array

I am trying to do something more complicated than it seems I should do.
I will provide a simplified version of what I am trying to accomplish, and then the actual version.
I need to use a function that takes a function as a parameter, and then returns a function.
The simplified version looks like this:
$a = array();

$a[1] = function($b) {
return function($c) {
$b *= $c;
return $b;


Which outputs:
array(1) {
string(4) “function”

I am using this to create a dynamic wrapper function around a PHP function. The actual function that I am calling accepts a function name and a function callback. The outputted function is to take the value passed from the original function, and multiply it by the value passed to the wrapper, and then return the result.
I need to be able to do the following:
$b = function($c) {
return $c * 2;

$a[‘b’] = $b;

//expected output is:
//$a[‘b’] = function($c) {
// return $c * 2;

//which would call the function $a[‘b’]($c)


Which would output:
//$a[‘b’] = function($c) {
// return $c * 2;

//which would then multiply $a[1](4) * 2 = 8

How can I create the original $a[1] function in such a way that I can do the dynamic wrapper?


Well, you can’t do what you are trying to do.
Variables in a closure are local to that instance.
What you are doing is making a new variable called $a[1] that will always point to the same function.
Your only option is to do this:
$a = array(
array(“name” => “one”, “function”