On Jan 29, 2008 1:53 PM, Christoph Boget <[EMAIL PROTECTED]> wrote:
> Constructors return the object, correct?  If so, how can I do this:
>
> class Bob {
>   private $blah;
>   _construct( $blah ) {
>     $this->blah = $blah;
>   }
>   public getBlah() {
>     return $this->blah;
>   }
> }
>
> echo Bob( 'Hello!' )->getBlah();
>
> When I try that, I get the message "Undefined function Bob".  I've also tried
>
> echo new Bob( 'Hello!' )->getBlah();
> echo (new Bob( 'Hello!' ))->getBlah();
>
> but PHP didn't like either of those at all.  Is it just not possible
> what I'm trying to do?
>
> I'm using PHP5.2.1
>
> thnx,
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

http://www.travisswicegood.com/index.php/2007/10/26/fluent_api_here_i_come

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

Reply via email to