PHP Classes

explicit variable declaration and data types

Recommend this page to a friend!

      PHP Classes blog  >  The 7 Main Optimizati...  >  All threads  >  explicit variable declaration and...  >  (Un) Subscribe thread alerts  
Subject:explicit variable declaration and...
Summary:suggestion for using explicit variable declaration and data type
Messages:2
Author:Ralf Strehle
Date:2012-07-05 16:57:39
Update:2012-07-05 22:50:50
 

  1. explicit variable declaration and...   Reply   Report abuse  
Picture of Ralf Strehle Ralf Strehle - 2012-07-05 22:22:29
Thanks for this interesting podcast.

Here is one suggestion for explicit data types. I have been working for some time with Access Basic and they have a declaration

Option Explicit

which you can place in the top of your file, and you then have to declare variables with type and get error messages when you access an undeclared variable or assign a wrong value to it or use it in a wrong context.

For mission critical applications this can be real important.

And it still allows to run old code which does not use explicit variable declaration.

  2. Re: explicit variable declaration and...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2012-07-05 22:50:50 - In reply to message 1 from Ralf Strehle
Yes, that could be one possibility to add optional support to type declaration.