For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2007 > Learning PHP; text from 2001, good or not?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Learning PHP; text from 2001, good or not?
Bruce Whealton

2007-02-05, 6:58 pm

Hi,
I have a slightly old text for learning PHP. It's from
2001, which is before PHP 5.2.x I think it is using PHP 4.x.y. Has PHP
changed radically enough that the
techniques taught back then will just cause problems?
I know that Set Globals or something like that is very
discouraged now. So, there are differences but are they
enough to not use this older text if writing code for PHP 5.2.x?
Thanks,
Bruce


J.O. Aho

2007-02-06, 3:58 am

Bruce Whealton wrote:
> Hi,
> I have a slightly old text for learning PHP. It's from
> 2001, which is before PHP 5.2.x I think it is using PHP 4.x.y.


Yes, if you are lucky it's PHP4, it's just a year after the release, so it
could still be PHP3.


> Has PHP changed radically enough that the
> techniques taught back then will just cause problems?
> I know that Set Globals or something like that is very
> discouraged now.


One of the major differences is the globlas, instead of using the variable
directly, you need to get it from the $_REQUEST. With version some functions
changes too, as rand() that don't need srand() anymore.


> So, there are differences but are they
> enough to not use this older text if writing code for PHP 5.2.x?


I would suggest you get yourself something written fro PHP5 is you are going
to use php5.2, as there are loads of new things for it.

--

//Aho
Dr. No

2007-02-06, 6:58 pm

Bruce Whealton wrote:
> Hi,
> I have a slightly old text for learning PHP. It's from
> 2001, which is before PHP 5.2.x I think it is using PHP 4.x.y. Has PHP
> changed radically enough that the
> techniques taught back then will just cause problems?
> I know that Set Globals or something like that is very
> discouraged now. So, there are differences but are they
> enough to not use this older text if writing code for PHP 5.2.x?
> Thanks,
> Bruce
>
>


There are quite a few subtle and not so subtle differences between PHP 4 and PHP
5; enough that O'Reilly published a book called "Migrating to PHP 5", which I
found quite useful in making the transition. If you like the book you have, you
should try to find a more recent edition of that book and see if it helps. There
is very little to gain from learning a computer language from a book that is
over six years old, unless you specifically want to work with PHP 4, which as
you stated, you don't.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com