News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brian Moon's Blog:
Initializing & typing variables with settype()
September 14, 2006 @ 07:01:47

In his latest post, Brian Moon talks about a method to help you and your code fit into an E_STRICT style of coding - the settype function.

These days, the way to develop is to have E_ALL and maybe even throw in E_STRICT if you are really hard core. That of course means having all your variables initialized before they are used.

In his view, defining them is good, but it's more "elegant" to use the settype function to make it more clear where they are defined. He also includes a function, using settype, that ensures that the entered values are what they should be (i.e. and int is an int).

0 comments voice your opinion now!
initializing typing variables settype declare e_strict initializing typing variables settype declare e_strict


blog comments powered by Disqus

Similar Posts

Vidyut Luther\'s Blog: \"Where do you \'define\' your environment variables\" ...update/workaround/s

Brian Moon's Blog: Initializing & typing variables with settype()

Jani Hartikainen's Blog: Static/Dynamic typing sweet spot

Brian Moon's Blog: Initializing & typing variables with settype()

Anthony Ferrara's Blog: PHP's Source Code For PHP Developers - Part 3 - Variables


Community Events





Don't see your event here?
Let us know!


language interview conference tips opinion threedevsandamaybe series community library release framework bugfix symfony laravel podcast zendserver api list introduction deployment

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework