btwael / mammouth

Unfancy PHP
http://mammouth.boutglay.com
MIT License
214 stars 22 forks source link

No concatenation operator? #6

Closed philip-peterson closed 11 years ago

philip-peterson commented 11 years ago

There doesn't seem to be a concatenation operator... how does one join two strings?

btwael commented 11 years ago

. operator is used for proprety access. the other ops are used in binary expression, but we will fix that.

btwael commented 11 years ago

@philip-peterson , now

hello = "hello"
word = "word"
echo(hello " " word)

is compiled to

$hello = 'hello';
$word = 'word';
echo($hello.' '.$word);
btwael commented 11 years ago

@philip-peterson , see this example: http://mammouth.wamalaka.com/#try:{{%0Ahello%20%3D%20%22hello%22%0Aword%20%3D%20%22word%22%0Aecho%28hello%20%22%20%22%20word%29%0A}}

btwael commented 11 years ago

@philip-peterson , you can read: http://mammouth.wamalaka.com/#concatenation