In this new post on CodeSnipers.com today, Nola compares some of the data types between PHP and Ruby.
PHP is not a strongly typed language. You can assign $foo an integer, print it (even though it does not contain a string), assign an array and so on. PHP doesn't care.
However, if you want to be certain of the type in a variable there are a few functions to help you out.
In conversation with a fellow PHP person now doing Perl, he asked… how does Ruby do types?? And I thought I knew how to answer him, but then when I opened my mouth I found I didn't have the words.
She doesn't really mention the Ruby datatypes (see here for that...), but she does mention some good ways to ensure that your variables contain what you think they should - or change them so they do...




