# Any recovering PHP coders around? was Re: x=does not work?

**URL:** <https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194>\
**Category:** Ruby\
**Created:** [November 4, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194 "2007-11-04T20:23:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 4, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194/1 "2007-11-04T20:23:36Z")

</div>

On 11/3/07, Joshua M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ups I’m sorry, I messed things up because PHP uses [] for both arrays  
> and hashes.

E-mail me off list if you want to help me with something. It’s  
occurred to me that it would be very useful to create a simple guide  
for the differences between Ruby and PHP syntax, but I don’t remember  
enough PHP to do it off the top of my head.

–  
Giles B.

Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 4, 2007, 10:40pm UTC](https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194/2 "2007-11-04T22:40:41Z")

</div>

Giles B. wrote:

> On 11/3/07, Joshua M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Ups I’m sorry, I messed things up because PHP uses [] for both arrays  
> > and hashes.
> 
> E-mail me off list if you want to help me with something. It’s  
> occurred to me that it would be very useful to create a simple guide  
> for the differences between Ruby and PHP syntax, but I don’t remember  
> enough PHP to do it off the top of my head.

Way, way back I started a section of the Rails wiki  
([http://wiki.rubyonrails.org/rails/pages/PHPEquivalents](http://wiki.rubyonrails.org/rails/pages/PHPEquivalents)) that was  
supposed to be a mirror of the PHP documentation structure so that  
people coming in from PHP would be able to easily figure out, through  
knowing the location of the relevant concept in the PHP documentation,  
what the Ruby equivalent is.

It never took off.

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 4, 2007, 11:36pm UTC](https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194/3 "2007-11-04T23:36:50Z")

</div>

> supposed to be a mirror of the PHP documentation structure so that  
> people coming in from PHP would be able to easily figure out, through  
> knowing the location of the relevant concept in the PHP documentation,  
> what the Ruby equivalent is.
> 
> It never took off.

The Rails wiki is a whole nother ball of wax. Let’s not even go there.  
The first edition of “The Ruby Way” had a cool set of appendices in  
this vein, e.g., “From Perl To Ruby,” “From Python To Ruby,” etc., but  
“From PHP To Ruby” is an idea whose time has really come.

–  
Giles B.

Blog: [http://gilesbowkett.blogspot.com](http://gilesbowkett.blogspot.com)  
Portfolio: [http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)  
Tumblelog: [http://giles.tumblr.com/](http://giles.tumblr.com/)

---

<div class="post-metadata">

**Author:** ![Giles\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/848f3c/32.png) [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Post date:** [November 5, 2007, 3:18am UTC](https://www.ruby-forum.com/t/any-recovering-php-coders-around-was-re-x-does-not-work/119194/4 "2007-11-05T03:18:59Z")

</div>

On Nov 4, 2007, at 3:53 PM, Giles B. wrote:

> > Way, way back I started a section of the Rails wiki  
> > The first edition of “The Ruby Way” had a cool set of appendices in  
> > this vein, e.g., “From Perl To Ruby,” “From Python To Ruby,” etc., but  
> > “From PHP To Ruby” is an idea whose time has really come.

Could be a trap. It may be tricky to keep it focused. Personally, I  
forgot almost all the PHP I knew. But learning Ruby worked better for  
me by not thinking about PHP at all.  
That said, I always found that the Oreilly book PHP Cookbook was  
excellent even just from showing concepts for web development, and it  
might be a good source of bits and pieces that could be shown done in  
Ruby to illustrate how very different it would be.  
The hardest thing will be the very non OOP nature of PHP compared  
with the very OOP nature of Ruby.  
PHP does have a tacked on object model, but most PHP is still done  
like C/C++.
