PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/facebook/hiphop-php
PHP | 14 lines | 7 code | 4 blank | 3 comment | 0 complexity | 09a3e9c1b32a74588b377751999d4f8f MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. // Straight unpacking and repacking (or transferrence)
  3. <<__EntryPoint>>
  4. function main_hni_printf() {
  5. printf("Pi is 3.%d4%c5%s2\n", ...varray[1, ord('1'), 9]);
  6. // Splat unpacked and repacked
  7. printf(...varray["Roses are %s, Violets are %s\n", "Red", "Blue"]);
  8. // Splat unpacking and repacking with new args
  9. printf("The meaning of life is %d not %d, or %s\n", 43, ...varray[42, "Yellow"]);
  10. }