declare_007.phpt 359 B

12345678910111213141516171819
  1. --TEST--
  2. Testing declare statement with ticks with callback arguments
  3. --FILE--
  4. <?php
  5. register_tick_function(function (stdClass $object, array $array) {
  6. echo "tick: ", get_class($object), " ", count($array), "\n";
  7. }, new \stdClass(), [1, 2, 3]);
  8. function foo() { }
  9. declare(ticks=1) {
  10. $statement;
  11. foo();
  12. }
  13. ?>
  14. --EXPECT--
  15. tick: stdClass 3
  16. tick: stdClass 3