Thread: php5
View Single Post
Old 08-06-2010, 06:23 AM   #1 (permalink)
ChrisR
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