PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/ext_preg/preg_replace_callback.php

http://github.com/facebook/hiphop-php
PHP | 20 lines | 17 code | 3 blank | 0 comment | 0 complexity | c78ef7ef149a9788e6ac91cb5ca7ef8e 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. function preg_replace_callback_main() {
  3. $count = -1;
  4. var_dump(preg_replace_callback(
  5. '/(a)/',
  6. function ($matches) {
  7. return str_repeat($matches[0], 500);
  8. },
  9. 'aaaaaaaaaaaaaaaaaaaa',
  10. -1,
  11. inout $count
  12. ));
  13. }
  14. <<__EntryPoint>>
  15. function main_preg_replace_callback() {
  16. preg_replace_callback_main();
  17. }