Var_Dump confusion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Var_Dump confusion

The input code is <? php $var1= "Hello world"; var_dump ($var1); ?> the supposed output is srting(11) "Hello world" but the displayed result is c:\wamp64\WWW\PHPCourse\Data_Type.php:string 'Hello world' (length=11) Why the directory of this file appeared? and how to fix it?

19th Jun 2019, 2:58 PM
Hosam Mohamed
Hosam Mohamed - avatar
1 Answer
+ 1
This is because of xdebug overloading var_dump. If you edit your php.ini and set "xdebug.overload_var_dump=1" you will no longer get the filename and line number with var_dump. The default setting is 2, which includes the filename and line number with the variable info. A setting of 0 will disable the xdebug override altogether. left click on "wampmanager" icon on windows tray, then select "PHP -> php.ini" so now find for "xdebug.overload_var_dump", then equal that "1" and save, restart wamp server...
3rd Sep 2020, 7:25 PM
Amin Maleki
Amin Maleki - avatar