public
Last active — forked from bxt/phpstringconcat.php

  • Download Gist
phpstringconcat.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
function foo (){
echo "in \n";
return "bar \n";
}
 
echo "\nComma:\n";
echo foo (),foo (),foo ();
echo "\nDot:\n";
echo foo ().foo ().foo ();
echo "\n";
 
/*
Result: . concat will execute all first, while m, will execute between outputs
Output:
 
Comma:
 
in
bar
in
bar
in
bar
 
Dot:
 
in
in
in
bar
bar
bar
 
*/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.