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-- get_object_vars() no-declared/declared discrepancies --FILE-- <?php class Test {..

Decoded Output download

--TEST--
get_object_vars() no-declared/declared discrepancies
--FILE--
<?php

class Test {
    public $prop;
}

// Using ArrayObject here to get around property name restrictions

$obj = new stdClass;
$ao = new ArrayObject($obj);
$ao["Ab"] = 42;
$ao["*b"] = 24;
$ao[12] = 6;
var_dump(get_object_vars($obj));

$obj = new Test;
$ao = new ArrayObject($obj);
$ao["Ab"] = 42;
$ao["*b"] = 24;
$ao[12] = 6;
var_dump(get_object_vars($obj));

?>
--EXPECTF--
array(3) {
  ["%0A%0b"]=>
  int(42)
  ["%0*%0b"]=>
  int(24)
  [12]=>
  int(6)
}
array(4) {
  ["prop"]=>
  NULL
  ["%0A%0b"]=>
  int(42)
  ["%0*%0b"]=>
  int(24)
  [12]=>
  int(6)
}

Did this file decode correctly?

Original Code

--TEST--
get_object_vars() no-declared/declared discrepancies
--FILE--
<?php

class Test {
    public $prop;
}

// Using ArrayObject here to get around property name restrictions

$obj = new stdClass;
$ao = new ArrayObject($obj);
$ao["\0A\0b"] = 42;
$ao["\0*\0b"] = 24;
$ao[12] = 6;
var_dump(get_object_vars($obj));

$obj = new Test;
$ao = new ArrayObject($obj);
$ao["\0A\0b"] = 42;
$ao["\0*\0b"] = 24;
$ao[12] = 6;
var_dump(get_object_vars($obj));

?>
--EXPECTF--
array(3) {
  ["%0A%0b"]=>
  int(42)
  ["%0*%0b"]=>
  int(24)
  [12]=>
  int(6)
}
array(4) {
  ["prop"]=>
  NULL
  ["%0A%0b"]=>
  int(42)
  ["%0*%0b"]=>
  int(24)
  [12]=>
  int(6)
}

Function Calls

None

Variables

None

Stats

MD5 ed706411d0da324b89e5fbb5e5aca8c6
Eval Count 0
Decode Time 97 ms