Phpdocumentor: @global tag

Created on 24 Apr 2017  路  6Comments  路  Source: phpDocumentor/phpDocumentor

Which tag can i use in the place of @global?
I read in the documentation, that isn't indicated the use this tag, so i would like to know by which one can i replace?

question

All 6 comments

I think what they mean is that using global is generally not recommended in PHP, and you are instead encouraged to use static class variables, or class constants.

Cool!!! Thank you too much, surged this doubt and I stayed: why not?? Thank you too much again.

Global can lead to strange behaviour that you will not understand in the future. Like where is this value comming from? Who changed my variable.

We are convinced that you should protect your application's state. which you cannot do when everyone has access. This might help: http://stackoverflow.com/questions/5166087/php-global-in-functions

Sure @jaapio , my wish is to use to represent a $_POST value in the method.

Think global should work in that case

Thank you too much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olvlvl picture olvlvl  路  6Comments

niden picture niden  路  4Comments

machitgarha picture machitgarha  路  4Comments

jrfnl picture jrfnl  路  5Comments

Schlaefer picture Schlaefer  路  4Comments