TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-06-2010, 06:23 AM   #1 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 16
Thanks: 2
ChrisR is on a distinguished road
Default php5

Ill start off by saying i think this would be the place to post this ;) Also if this is not meant to be posted on this forum feel free to delete it :p


Well i am working on a private project (not a forum but something for my self) and i am coding in php5 i know how to do basic OOP in php4 but i am trying to learn a lot about php5 and there are something i am having issues with finding on the web. ill do it in points.


(note this is not really code just mockup to try and show you what i mean)


1) Would this be logical in making a database layer.


PHP Code:

abstract class driver {


protected function 
connect (perms here) {

mysql_connect()

}


}


class 
db extends driver {


public function 
connect(perms here) {


parent::connect(perms here);




if its not logical what would be the best way to go about it?


2) when do you use static/final etc.. keywords as in my coding i have never seen the need for it or whens it best to use it.


3) When needing to use other classes in a class is it best to do it this way or is there a better way?


PHP Code:

class foo {


private 
$see NULL;


public function 
loo() {


global 
$see;


$this->see = &$see;


}


}


class 
see {


code here ....


}


$see = new see

So that's all i want to know right now also if you have any other tips for coding in php5 oo i am all ears.
ChrisR is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Muting errors in PHP5 Ross General 4 06-30-2008 03:13 PM
PHP5 Classes A to Z Part 1 quantumkangaroo Advanced PHP Programming 11 04-01-2008 04:21 AM
Resource Sites for PHP5 Orc General 4 01-08-2008 05:33 PM
PHP5 Tutorials - Creating a PHP5 Class sunilbhatia79 Tips & Tricks 5 11-15-2007 01:50 PM
Php4 & Php5 obolus Absolute Beginners 5 10-21-2007 04:06 PM


All times are GMT. The time now is 12:44 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design