Results 1 to 9 of 9

Thread: Combine a PHP Statement

  1. #1

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Combine a PHP Statement

    How can I combine the following into one statment?

    PHP Code:
    $tableCreator = new tableCreator;
    $table $tableCreator->createJSTable(); 
    Thanks

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Combine a PHP Statement

    as techgnome said, you cant. Why do you want to do this?
    My usual boring signature: Something

  4. #4

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: Combine a PHP Statement

    im a lazy bastard.

  5. #5
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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

  6. #6
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Combine a PHP Statement

    This?

    PHP Code:
    $table tableCreator::createJSTable(); 


    Has someone helped you? Then you can Rate their helpful post.

  7. #7

    Thread Starter
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: Combine a PHP Statement

    Thanks!

  8. #8
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Combine a PHP Statement

    Quote Originally Posted by dclamp View Post
    that is a terrible reason. It is 1 extra line...

    Answer to original question: no.
    It's a perfectly valid reason.

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Combine a PHP Statement

    Quote Originally Posted by manavo11 View Post
    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
  •  



Click Here to Expand Forum to Full Width