|
-
Mar 17th, 2009, 10:27 PM
#1
Thread Starter
Hyperactive Member
Combine a PHP Statement
How can I combine the following into one statment?
PHP Code:
$tableCreator = new tableCreator;
$table = $tableCreator->createJSTable();
Thanks
-
Mar 17th, 2009, 10:57 PM
#2
Re: Combine a PHP Statement
Don't think you can. First line creates an instance of an object, the second uses that new object to call a method which creates another object.
-tg
-
Mar 18th, 2009, 06:20 PM
#3
Re: Combine a PHP Statement
as techgnome said, you cant. Why do you want to do this?
My usual boring signature: Something
-
Mar 18th, 2009, 10:05 PM
#4
Thread Starter
Hyperactive Member
Re: Combine a PHP Statement
-
Mar 18th, 2009, 10:21 PM
#5
Re: Combine a PHP Statement
that is a terrible reason. It is 1 extra line...
Answer to original question: no.
My usual boring signature: Something
-
Mar 19th, 2009, 09:50 AM
#6
-
Mar 19th, 2009, 08:49 PM
#7
Thread Starter
Hyperactive Member
Re: Combine a PHP Statement
-
Mar 19th, 2009, 08:55 PM
#8
Re: Combine a PHP Statement
 Originally Posted by dclamp
that is a terrible reason. It is 1 extra line...
Answer to original question: no.
It's a perfectly valid reason.
-
Mar 19th, 2009, 08:59 PM
#9
Re: Combine a PHP Statement
 Originally Posted by manavo11
This?
PHP Code:
$table = tableCreator::createJSTable();
This approach requires that the method is declared static.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|