Jump to content

Using a class inside another class


fogeytron

Recommended Posts

Hello there,

This is not my exact code, just the general idea.

class.c.inc
------------------
class C
{
.
.
.
}

-------------------
include 'class.c.inc';
class A
{
var $b = new C();
.
.
.
}

error

Parse error: parse error in /Users/jonathan/fogeytron_be/www/DNS/class.zonefile.inc on line 9

Where line 9 is var $b = new C();.

I have not seen any code that attempts this. I have done it in C++. It seems rather basic. So I think I am calling it incorrectly.

Please help?
Link to comment
https://forums.phpfreaks.com/topic/6990-using-a-class-inside-another-class/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.