Current location: Hot Scripts Forums » Programming Languages » PHP » Programming in PHP5?


Programming in PHP5?

Reply
  #1 (permalink)  
Old 04-17-05, 06:20 PM
Lasha Lasha is offline
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-18-05, 03:49 AM
dennispopel dennispopel is offline
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-18-05, 03:51 AM
dennispopel dennispopel is offline
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 04-18-05, 10:10 AM
moronovich moronovich is offline
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...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 04-23-05, 06:53 PM
Lasha Lasha is offline
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 04-23-05, 07:45 PM
NeverMind's Avatar
NeverMind NeverMind is offline
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]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 05-02-05, 09:05 PM
Lasha Lasha is offline
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....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux, Networking, Hardware and Programming Support DislexiK General Advertisements 0 03-29-05 05:24 PM
Is it Time or Too Soon to upgrade to PHP5 ? MrMMM PHP 3 01-19-05 09:11 AM
PHP5 Hosting account for FREE w/ any purchase! mxhub General Advertisements 0 10-07-04 12:52 PM
on the way to PHP5 OO programming mikaelf PHP 1 10-06-04 11:53 PM
php visual basic perl cgi - outsource programming to india outsource_india General Advertisements 0 10-28-03 04:21 AM


All times are GMT -5. The time now is 08:31 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.