1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

How Does Ruby Compare to PHP?


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.

  1. About.com
  2. Technology
  3. Ruby
  4. Beginning Ruby
  5. How Does Ruby Compare to PHP?

©2014 About.com. All rights reserved.