
04-17-05, 06:20 PM
|
|
New Member
|
|
Join Date: Dec 2004
Location: Somewhere On Earth...
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Programming in PHP5?
Hey guys. I'm gonna start learning PHP and MySQL soon, and I was wondering if programming for regular PHP(4) would be the same for PHP5. I mean, do you have to learn new things, and learn how to program differently, or what? Thanks for the help...Any miscellaneous info about PHP5 and etc. would be nice too. Thanks!
|

04-18-05, 03:49 AM
|
|
Coding Addict
|
|
Join Date: Mar 2005
Posts: 263
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello,
From the first look PHP5 is no different from PHP4, i.e., the PHP4 code will run fine on PHP5. However, PHP5 has redesigned OO support and the very big difference is the fact that objects are now always passed and assigned by reference, so there may be problems with PHP4 object-oriented code, when you relied on copying instances rather than passing them by reference.
Also PHP5 is said to be alot faster than PHP4. Besides, it has one more cool feature called dereferencing of function and method calls: you now can write like:
echo $myObject->myMethod1()->someOtherObjectMethod2();
The OO support was extended to support interfaces, exceptions, reflection, static properties etc. Please google for PHP5 OOP - you surely will find lots on that.
__________________
onPHP5.com - PHP5: Articles, News, Tutorials, Interviews, Software and more
|

04-18-05, 03:51 AM
|
|
Coding Addict
|
|
Join Date: Mar 2005
Posts: 263
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
On the other hand, be aware that a very few hosts support PHP5 yet. Also, if you have more specific questions please ask.
__________________
onPHP5.com - PHP5: Articles, News, Tutorials, Interviews, Software and more
|

04-18-05, 10:10 AM
|
|
Junior Code Guru
|
|
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
php4 and php5 are different in the architecture. php 5 is written on zend 2, while php 4 still utilizes zend 1. to know about the difference, you can:
1. rtfm (f= friendly)
2. read other's userland code.
3. read the (c) source code(cvs.php.net)
fyi, you can run apache with both php4 and php5 on your server. john ever wrote an article about this. (i forgot where, maybe in onlamp.com or coggeshall.org).
happy reading! 
__________________
just an ignorant noob with moronic solution...
|

04-23-05, 06:53 PM
|
|
New Member
|
|
Join Date: Dec 2004
Location: Somewhere On Earth...
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hmm, this is very interesting. What if I were to buy a PHP/MySQL from Larry Ullman, which I am sure almost all of you know? Are they going to be updated to teach PHP5 soon, or are those books already updated?
Also, what does "OO" stand for?
Also, dennisspopel, what does that line of PHP code stand for? What's it used for? What does it represent - PHP5-wise. Thanks.
|

04-23-05, 07:45 PM
|
 |
Community VIP
|
|
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
|
|
some people' impressions about Larry's Book:
http://www.simplemachines.org/commun...7675#msg207675
I haven't read the book btw so I can't judge it myself..
but if the author didn't actually care about avoiding E_NOTICEs, this is not good IMHO..
OO stands for Object-Oriented
as for: $myObject->myMethod1()->someOtherObjectMethod2();
dennis was trying to demonestrate what dereferencing means and how it's used..
I say don't worry about this for now, and leave it until you get the idea of OOP 
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
|

05-02-05, 09:05 PM
|
|
New Member
|
|
Join Date: Dec 2004
Location: Somewhere On Earth...
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
What do Error Notices actually do? What are they for? I'm new to this, so I'm just getting to know the backnote stuff....
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|