Originariamente inviato da ZioLuffio
Sì, è corretta la 1, infatti in PHP il tipo di una variabile varia in base al contenuto della variabile stessa, e non nella sola fase di dichiarazione come accade in C e altri linguaggi.
più che altro perchè in "fase di dichiarazione" non puoi dichiarare il tipo della variabile

http://www.php.net/manual/en/languag...e-juggling.php

PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by the context in which the variable is used. That is to say, if a string value is assigned to variable $var, $var becomes a string. If an integer value is then assigned to $var, it becomes an integer.