Assume color = "orange";
Ruby:
puts("My favorite color is #{color.downcase() + 'ish'} -- at least for now.");
print("My favorite color is {strtolower( $color ) + 'ish'} -- at least for now.");
You can't call plain functions inside strings like that, but you can coax the parser into doing strange things:
<?php
print "{$a->b()}"; // Works
//Parse error: syntax error, unexpected '(' in Command line code on line 1
print "${time()}";
print "${$a=time()} $a"; // Also works: prints "1234380996"
?>
As long as it sees a valid variable at the start, it'll go ahead and interpolate an entire statement without complaining.
For those who were wondering, yes, this works too...
<?php
print "${$a or print shell_exec('ls')}";
?>