bug70681.phpt 379 B

12345678910111213141516
  1. --TEST--
  2. Bug #70681: Segfault when binding $this of internal instance method to null
  3. --FILE--
  4. <?php
  5. $c = (new ReflectionMethod('SplStack', 'count'))->getClosure(new SplStack);
  6. $c = $c->bindTo(null);
  7. $c = (new ReflectionFunction('strlen'))->getClosure();
  8. $c = $c->bindTo(null);
  9. var_dump($c("foo"));
  10. ?>
  11. --EXPECTF--
  12. Warning: Cannot unbind $this of method in %s on line %d
  13. int(3)