News Archive
PhpRiot Newsletter
Your Email Address:

More information Confessions of a Converted PHP Developer: On Visibility and Privates

Note: This article was originally published at PHPDeveloper on 13 May 2011.

From there's a new post from a confessed developer who moved from PHP to Ruby about PHP's private visibility rules and how they compare to Ruby's.

Alright class - today I'm here to talk about the differences and similarities that PHP and Ruby have when it comes to object properties, methods, and their visibility - how you create variables inside classes, and how you can interact with them.

He compares the private properties in PHP classes to the corresponding handling in Ruby, including the getters and setters to go with them. There's also a look at class visibility settings in Ruby.