hiphop-php /hphp/test/slow/variadic_args/hni.printf.php

Language PHP Lines 11
MD5 Hash 744f3358a23938e11e430a7ffb82f55c Estimated Cost $61 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php

// Straight unpacking and repacking (or transferrence)
printf("Pi is 3.%d4%c5%s2\n", ...[1, ord('1'), 9]);

// Splat unpacked and repacked
printf(...["Roses are %s, Violets are %s\n", "Red", "Blue"]);

// Splat unpacking and repacking with new args
printf("The meaning of life is %d not %d, or %s\n", 43, ...[42, "Yellow"]);
Back to Top