[eluser]jozeunico[/eluser]
Try this function please:
Code:
function Foo()
{
$message_one = 'Message ONE';
$message_two = 'Message TWO';
$CI = &get;_instance();
echo "<br/>message_one:".$message_one;
echo "<br/>message_two:".$message_two;
echo "<br/>Var Dump of CI:<br>:".var_dump($CI);
}
The output it will be something like:
message_one:Message ONE
message_two:Message TWOobject(Welcome)#9 (10) { ["_ci_scaffolding"]=> bool(false) ["_ci_scaff_table"]=> bool(false) ["config"]=> &object;(CI_Config)#3 (2) { ["config"]=> &array;(34) { ["base_url"]=> string(34) "http://localhost/pruebas/Mylibrary" ["index_page"]=> string(9) "index.php"
....THIS STUFF CONTINUES AND AFTER IT COMES:Var Dump of CI:
Just in case that you didn't notice, the var_dump function's result and the message "Var Dump of CI"
are in reverse order at the output in the browser.In fact I was expecting something like:
message_one:Message ONE
message_two:Message TWO
Var Dump of CI:object(Welcome)#9 (10) { ["_ci_scaffolding"]=> bool(false) ["_ci_scaff_table"]=> bool(false) ["config"]=> &object;(CI_Config)#3 (2) { ["config"]=> &array;(34) { ["base_url"]=> string(34) "http://localhost/pruebas/Mylibrary" ["index_page"]=> string(9) "index.php"
....AND SO ON...
I know this is not a "big deal" but it seems really weird to me. So if someone can tell me if this is a bug in CI or even of var_dump function or maybe a normal behavior or any reason about this I'll be really grateful.
I gave a quick look to the source code of the html generated and I notice something weird (Ctrl-U with FireFox 2.x/3.x) probably with quotes,the source code it turns red just from :
["<![CDATA["]=>
string(12) "<![CDATA["
}
'til the end, but I have no idea about this behavior.