I've looked around SO, but can't find an explanation to what is going on in my $_SESSION variables.
@ob_start();
$k=@ob_get_contents();
@ob_end_clean();
@session_start();
unset($s,$m);
$m1 = explode(" ", microtime());
$stime = $m1[1] + $m1[0];
echo $k;
$_SESSION['resendConfirmation']['function'] = 'resend';
$_SESSION['resendConfirmation']['id'] = '8';
print_r($_SESSION);
outputs:
Array ( [resendConfirmation] => 8esend )
Why is it string replacing? I've never had this issue before.
What I want is thus:
Array([resendConfirmation] => Array(
[id] =>8
[function} => resend
)
)
I've never had this happen before, I'm totally confused!
UPDATE In response to @DanRedux I've changed to two non-existent variable names to take the referencing out of the equation, still the same result...
$_SESSION['resendConfirmation']['tweak'] = 'resend';
$_SESSION['resendConfirmation']['tweak2'] = '8';
Same result :(
Did a sitewide query of resendConfirmation
and none were found, but once I change that array name, it all worked, baffled, but fixed...
$_SESSION['reConfirm']['function'] = 'resend';
$_SESSION['reConfirm']['id'] = '8';
print_r($_SESSION);
$_SESSION['resentConfirmation']['id']
is somehow referring to the first index, that's why the first character is changing, so why would ['id'] refer to [0].. Maybe you set it by reference at some point? – DanRedux May 10 '12 at 19:12@
, it suppresses warnings you might care about and has a pretty hefty performance hit. None of the functions in your code should misbehave if you check your inputs properly. There are some exceptions where@
is useful but even then it's dubious. – Frits van Campen May 10 '12 at 19:12Array ( [resendConfirmation] => Array ( [function] => resend [id] => 8 ) )
– Tibor May 10 '12 at 19:14