$carname;
does not in fact do anything. It’s neither using the variable for any operation, nor is it assigning anything to it. In PHP variables are “initialised” by assigning something to them. If anything, $carname;
is the same as echo $carname;
without the echo
, it’s just a NOOP. In fact, the first line doesn’t do anything either, the first var_dump
triggers an Undefined variable carname
notice.
solved Why the prevoius value still exists after reinitialaize variable – PHP