Re: {} forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 November 2011 13:56, Tim Streater <tim@xxxxxxxxxxxxxxxx> wrote:
> I'm looking at the source of a web sockets server and I see these various forms:
>
>  "ws://{$host}{$path}"
>  "HTTP/1.1 ${status}\r\n"
>
> Are these simply equivalent to:
>
>  "ws://" . $host . $path
>  "HTTP/1.1 " . $status . "\r\n";
>
> and if so, is there any particular benefit to using that form? Or if not, what do they mean?
>
> (I've read up about variable variables).
>
> Thanks,
>
> --
> Cheers  --  Tim
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

If you want to embed $array[CONSTANT], then the {} is used.

I use {} out of habit for non arrays. Not sure if there is an impact.

http://docs.php.net/manual/en/language.types.string.php#example-71
shows the use.

Oh. I've fixed the layout bug for
http://docs.php.net/manual/en/language.types.string.php#example-70.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc : Fantasy Shopper
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea :
fan.sh/6/370

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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux