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

CodeSnipers.com:
Data Types - PHP Vs Ruby (Part 2)
Nov 02, 2005 @ 11:23:11

Continuing their look at datatypes in PHP (and Ruby), CodeSnipers.com has this new post from Nola.

Ruby's types are actually objects with methods, which is different than PHP's primitive types. At first, I thought I'll have to do something like: age = Number.new(28).

Not so, in fact the number classes don't even have a new method. Declaring a value to be a number is: age = 28;

This time, she takes more of a look into Ruby and some of the functionality that it has to handle numbers and modify them (rounding, absolute value, etc). She notes, though, that Ruby seems to be loosely typed, similar to PHP - making it more flexible of a language...

tagged:

Link:


Trending Topics: