Re: Using -> operator for declarations?
| From: | Greg Beaver | Date: | Fri, 02 Jan 2004 16:17:17 +0000 |
| Subject: | Re: Using -> operator for declarations? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-173639@lists.php.net to get a copy of this message | ||
Hi Marco,
This is and has always been possible, php is not a strongly typed language.
Regards,
Greg
--
phpDocumentor
http://www.phpdoc.org
Marco Skulschus wrote:
Maybe, it was "correct" even in the past, but I am astonished that the following special "variable declaration" works. Although there is not var $MissingText in the class, one can fill it with data and pass it to the object. <?php class Output { var $Text; function PrintOutput($Text){ echo $Text; } } $Message = new Output(); // first attempt $Message -> Text = "Hello World"; $Message -> PrintOutput($Message -> Text); // second attempt $Message -> MissingText = "Hello Moon"; $Message -> PrintOutput($Message -> MissingText); ?> Maybe you can correct me. Marco