Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Professional to do this?

$
0
0

I checked numerous reputable sources(php.net/stack overflow etc) couldn't find any answer in regards.

echo $var = 'this var was undeclared before this';

As you can see, I am echoing and setting a variable all at once.

 

It seems to work ok with no errors, but I do not remember reading this in the past in any php books, nor can I remember seeing it in any open source code.

Wondering if it is bad practice?

 

On another note,

echo $var[1] = 'this array and key|value was undeclared before this';

works too

 

Thanks in advance.

 

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles