Hi all. As the subject suggests, I am using PHP4 and am having something
going on that I don't think should be.
Presume the following code
class Foo {
function Foo () {
return Bar;
}
}
$foo = new Foo;
echo $foo;
$foo comes out as an object. Does this have to be done in two line
[snip]
Hi all. As the subject suggests, I am using PHP4 and am having something
going on that I don't think should be.
Presume the following code
class Foo {
function Foo () {
return Bar;
}
}
$foo = new Foo;
echo $foo;
$foo comes out as an object. Does this have to be done in two
Im sure you should be returning a value in your constructor at all?? Ill
check the manual, but i dont think ive ever seen a constructor return
anything, doesnt sound right.. Let me check.
Jason
Jed R. Brubaker [EMAIL PROTECTED] wrote:
Hi all. As the subject suggests, I am using PHP4 and am
* Jason Davidson [EMAIL PROTECTED]:
Im sure you should be returning a value in your constructor at all?? Ill
check the manual, but i dont think ive ever seen a constructor return
anything, doesnt sound right.. Let me check.
From my experience, returning a value from a constructor currently
On Wed, 2004-08-11 at 11:14, Jed R. Brubaker wrote:
Hi all. As the subject suggests, I am using PHP4 and am having something
going on that I don't think should be.
Presume the following code
class Foo {
function Foo () {
return Bar;
}
}
$foo = new Foo;
echo $foo;
Yup, i typo'd .. should have read, Im not sure you should be returning a
value..
Jason
Matthew Weier O'Phinney [EMAIL PROTECTED] wrote:
* Jason Davidson [EMAIL PROTECTED]:
Im sure you should be returning a value in your constructor at all?? Ill
check the manual, but i dont think ive
On Wed, 11 Aug 2004 09:14:08 -0600, Jed R. Brubaker
[EMAIL PROTECTED] wrote:
Hi all. As the subject suggests, I am using PHP4 and am having something
going on that I don't think should be.
Presume the following code
class Foo {
function Foo () {
return Bar;
You shouldn't be
hi.
i've recently realized that the little oo code i've written is
actually not very oo at all. it's more like procedural code wrapped in a
class.
armed with my new knowledge i'm in the process of modifying my current
classes to be more oo (or what i like to this is more oo). so i'm going
to ask
. Parker [mailto:[EMAIL PROTECTED]
Sent: Monday, April 19, 2004 1:33 PM
To: [EMAIL PROTECTED]
Subject: [PHP] oo question
hi.
i've recently realized that the little oo code i've written is
actually not very oo at all. it's more like procedural code wrapped in a
class.
armed with my new knowledge i'm
Edward Peloke mailto:[EMAIL PROTECTED]
on Monday, April 19, 2004 10:49 AM said:
this: function Customer($customer_id = 0)
doesn't always set the customer_id to 0 even when you pass one in?
no. that is the default value for a function if *no* value is passed in.
chris.
--
PHP General
Chris W. Parker
on Monday, April 19, 2004 11:03 AM said:
Edward Peloke mailto:[EMAIL PROTECTED]
on Monday, April 19, 2004 10:49 AM said:
this: function Customer($customer_id = 0)
doesn't always set the customer_id to 0 even when you pass one in?
no. that is the default value
Chris W. Parker wrote:
hi.
i've recently realized that the little oo code i've written is
actually not very oo at all. it's more like procedural code wrapped in a
class.
armed with my new knowledge i'm in the process of modifying my current
classes to be more oo (or what i like to this is more
Chris,
Apr 19 at 10:33am, Chris W. Parker wrote:
my question has to do with abstraction (i think that's the word).
I think what you're talking about here is encapsulation. And yes, you are
correct to point out that the second approach allows the more
encapsulation of the object's data. Using
Kelly Hallman mailto:[EMAIL PROTECTED]
on Monday, April 19, 2004 12:34 PM said:
I think what you're talking about here is encapsulation.
in that case what is abstraction?
PROPOSED CHANGE:
class Customer {
...
function initialize_customer($customer_id) {
// grab data from
Apr 19 at 3:46pm, Chris W. Parker wrote:
Kelly Hallman mailto:[EMAIL PROTECTED]
I think what you're talking about here is encapsulation.
in that case what is abstraction?
I suppose it's pretty similar, but I believe that encapsulation is the
pedantic term for hiding the data structure
I was wondering can I create a new Object inside of a different class?
class One
{
//constructor
function One
{
$this-two = new Two;
$this-test = $this-two-test();
}
}
Can you do that? If so is that how you do it?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Monday, June 10, 2002, at 12:17 PM, Jay wrote:
I was wondering can I create a new Object inside of a different class?
class One
{
//constructor
function One
{
$this-two = new Two;
$this-test = $this-two-test();
}
}
Can you do that? If so is that how you do it?
Exactly.
Yes, you can do that and yes that's how you do it :)
Danny.
- Original Message -
From: Jay [EMAIL PROTECTED]
To: Php-General (E-mail) [EMAIL PROTECTED]
Sent: Monday, June 10, 2002 5:17 PM
Subject: [PHP] OO Question
I was wondering can I create a new Object inside of a different
Im no OO coder but I did try this before.
I made (well started to anyway) a class that uses two other classes, and
yes,
$this-that-do_something() did work for me
Jay wrote:
I was wondering can I create a new Object inside of a different class?
class One
{
//constructor
function One
{
I want to be able to override a function/method in a parent class, but then
call that function/method from within the overriden function in the child
class. The Zend documentation states you can do this:
In PHP 4.0 you can call member functions of other classes from within
member functions or
I want to be able to override a function/method in a parent class, but then
call that function/method from within the overriden function in the child
class. The Zend documentation states you can do this:
In PHP 4.0 you can call member functions of other classes from within
member functions or
You can use the special name parent. e.g.:
parent::baseClassFunction();
-Original Message-
From: christian calloway [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 08, 2001 2:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OO question
I want to be able to override a function
22 matches
Mail list logo