Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Test array_reduce() function : variation - object callbacks --FILE-- <?php echo "..

Decoded Output download

*** Testing array_reduce() : variation - object callbacks ***

Did this file decode correctly?

Original Code

--TEST--
Test array_reduce() function : variation - object callbacks
--FILE--
<?php
echo "*** Testing array_reduce() : variation - object callbacks ***\n";

class A {
  static function adder($a, $b) {return $a + $b;}
  public function adder2($a, $b) {return $a + $b;}
}

$array = array(1);

echo "\n--- Static method callback ---\n";
var_dump(array_reduce($array, array("A", "adder")));

echo "\n--- Instance method callback ---\n";
var_dump(array_reduce($array, array(new A(), "adder2")));

?>
--EXPECT--
*** Testing array_reduce() : variation - object callbacks ***

--- Static method callback ---
int(1)

--- Instance method callback ---
int(1)

Function Calls

None

Variables

None

Stats

MD5 dca81b84c5544277f5906093afc3264c
Eval Count 0
Decode Time 90 ms