yes thats what i was thinking itd a good idea , heh well php4 OO is
basically a container of functions which allows you to throw variables
around the place within it , i have most my privates within underscores so a
global string replace wont be so painful , i guess thats what the whole idea
of functions starting with underscores anyway ?

-----Original Message-----
From: Burhan Khalid [mailto:[EMAIL PROTECTED]
Sent: Saturday, April 05, 2003 2:08 AM
To: Dan Rossi
Subject: Re: [PHP] php5 writeup


Dan Rossi wrote:
> what exactly do namespaces do , i can sorta see whats its doin
>
> and this is what i want !!
[ snip ]

Namespaces are provided to add an additional "scope" to a function. For
example (from C++) the cout and endl functions are in defined in the
namespace std. So, say you are writing a program in which you have your
own function called cout. To let the compiler know which cout you are
talking about, you can use std::cout (which itendifies the namespace
std). This lets the compiler know that at that point in the program, you
want to reference the cout function defined in the namespace std.

I always think of namespaces as another "container" for grouping
functions. I know this might make hard-core OOP programmers cringe, but
I have found that looking at it this way has avoided me confustion. Feel
free to correct as appropriate :)

>
> yep this is cool i've already tested it out and it works , but what is the
> whole point of private and protected again ? i've been reading the java
> intro on the sun site and it goes into detail about it

Private and protected are access/scope modifiers in OOP that provide for
the encapsulation of objects. Generally, private members are only
accessable by members of their class, and protected members are
inherited by child classes. That's the q&d way of explaining it. Any
good OOP reference (like the java reference you mentioned) will give you
more information on the topic.

[ snip ]

> wots the point of this ? http://ny1.php.net/talks/show.php/php5intro/28
>

If you don't get the humor, I would point to your friendly art museum guide.

If you don't get the OOP ...

An abstract class is one that defines functions that other classes
inherit. Think of it as a "parts bin" class, from which you borrow bits
to plug into other classes.

I would suggest picking up a good OOP reference to find out more about
inheritence, scope, etc.

> ahh my brain hurts i got lost after this but i am so excited , i have 5
> running i should start doing some OO experiments.
>

Soon, so shall I. <rubbin hands in anticipation>

[ snip ]

--
Burhan Khalid
phplist[at]meidomus[dot]com

Please trim your posts, and add a reply-to header that points to the
list so that when someone replies, it goes to the list. Don't know why
the list doesn't default to this.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to