recv_003.phpt 534 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. JIT RECV: slow type check
  3. --INI--
  4. opcache.enable=1
  5. opcache.enable_cli=1
  6. opcache.file_update_protection=0
  7. opcache.jit_buffer_size=1M
  8. opcache.protect_memory=1
  9. ;opcache.jit_debug=257
  10. --EXTENSIONS--
  11. opcache
  12. --FILE--
  13. <?php
  14. class A {
  15. }
  16. class B extends A {
  17. }
  18. class C {
  19. }
  20. function test(A $x)
  21. {
  22. echo "ok\n";
  23. }
  24. test(new B);
  25. test(new C);
  26. ?>
  27. --EXPECTF--
  28. ok
  29. Fatal error: Uncaught TypeError: test(): Argument #1 ($x) must be of type A, C given, called in %s:9
  30. Stack trace:
  31. #0 %s(15): test(Object(C))
  32. #1 {main}
  33. thrown in %s on line 9