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_sum() function : usage variations - array with reference variables as ..

Decoded Output download

*** Testing array_sum() : array with elements as reference ***

Did this file decode correctly?

Original Code

--TEST--
Test array_sum() function : usage variations - array with reference variables as elements
--FILE--
<?php
/*
* Testing array_sum() with 'input' having reference variables as elements
*/

echo "*** Testing array_sum() : array with elements as reference ***\n";

$value1 = -5;
$value2 = 100;
$value3 = 0;
$value4 = &$value1;

// input array containing elements as reference variables
$input = array(
  0 => 10,
  1 => &$value4,
  2 => &$value2,
  3 => 200,
  4 => &$value3,
);

var_dump( array_sum($input) );

echo "Done"
?>
--EXPECT--
*** Testing array_sum() : array with elements as reference ***
int(305)
Done

Function Calls

array_sum 1

Variables

$input [{'key': 0, 'value': 10}, {'key': 1, 'value': -5}, {'key': 2, 'value': 100}, {'key': 3, 'value': 200}, {'key': 4, 'value': 0}]
$value1 -5
$value2 100
$value3 0
$value4 -5

Stats

MD5 00ff808d55deb165ee0d45d997acac88
Eval Count 0
Decode Time 95 ms