1. Home
  2. Computing & Technology
  3. Ruby

How Does Ruby Compare to PHP?

By Amanda & Michael Morin, About.com

Ruby vs. PHP

PHP was originally designed as a "BASIC for the World Wide Web," an ideal language for making small dynamic web pages. Since then it's grown so much that it's now easily the most popular language with which to create dynamic web pages and web applications.

Though PHP is object oriented, the object oriented features are not always used. Ruby, on the other hand, was designed from the start as an object oriented language and is difficult to use in any other way.

Object Orientation as an Afterthought?

Ruby on Rails and other Ruby web frameworks can be used to perform the same tasks as PHP, but yet the languages differ quite a bit. Object oriented programming was added to PHP as an afterthought. PHP version 5 has a complete set of object oriented features, but since it's not backwards-compatible with PHP version 4, its adoption has been limited.

Differences in Deployment

One big difference is in deployment: uploading and running your programs on the Web. PHP is almost universally supported by all Web hosts, and is often viewed as the de facto language for the World Wide Web. Ruby is quite new to the World Wide Web, and has only been widely supported since Ruby on Rails became popular in 2004. Because of this, not all Web hosting companies support Ruby on their servers.

Explore Ruby
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Ruby
  4. Beginning Ruby
  5. How Does Ruby Compare to PHP?

©2009 About.com, a part of The New York Times Company.

All rights reserved.