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-- Refcount inference when adding array elements --EXTENSIONS-- opcache --FILE-- <?p..

Decoded Output download

--TEST--
Refcount inference when adding array elements
--EXTENSIONS--
opcache
--FILE--
<?php

function test($a) {
    $ary = [$a];
    $ary2 = [0, $ary, $ary];
    return $ary2;
}
var_dump(test(1));

?>
--EXPECT--
array(3) {
  [0]=>
  int(0)
  [1]=>
  array(1) {
    [0]=>
    int(1)
  }
  [2]=>
  array(1) {
    [0]=>
    int(1)
  }
}

Did this file decode correctly?

Original Code

--TEST--
Refcount inference when adding array elements
--EXTENSIONS--
opcache
--FILE--
<?php

function test($a) {
    $ary = [$a];
    $ary2 = [0, $ary, $ary];
    return $ary2;
}
var_dump(test(1));

?>
--EXPECT--
array(3) {
  [0]=>
  int(0)
  [1]=>
  array(1) {
    [0]=>
    int(1)
  }
  [2]=>
  array(1) {
    [0]=>
    int(1)
  }
}

Function Calls

None

Variables

None

Stats

MD5 27de7bf3d14baf63b00dd29cb51103b2
Eval Count 0
Decode Time 93 ms