- var_dump: documentation ( source)
<?php
$x = new stdclass;
$x->{"whatever"} = 1337;
$x = (array)$x;
var_dump($x);
//$x = array("42" => 1337);
foreach ($x as $key => $value)
{
var_dump($key);
if (!array_key_exists((string)$key, $x))
echo 'wtf';
}
?>