I've tried and came to know that if i use
$a .="test";
$a .=" test2";
and echo out $a
echo $a
it returns
test test2
also for arrays
<?php
$testarray['Title'] = "test";
$testarray['text'] = "text";
print_r($testarray);
?>
it gives the proper result without declaring $testarray=[];
Array ( [Title] => test [text] => text )
It does not even shows the warning or notice.. so i just want to know is it good practice to declare the variable before or both are ok.. also if it is related to any particular php version.. i am using php 7.1 will it show error in earlier version?