018.phpt 483 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. FFI 018: Indirectly recursive structure
  3. --EXTENSIONS--
  4. ffi
  5. --INI--
  6. ffi.enable=1
  7. --FILE--
  8. <?php
  9. try {
  10. FFI::cdef("struct X {struct X x[2];};");
  11. echo "ok\n";
  12. } catch (Throwable $e) {
  13. echo get_class($e) . ": " . $e->getMessage()."\n";
  14. }
  15. try {
  16. FFI::cdef("struct X {struct X *ptr[2];};");
  17. echo "ok\n";
  18. } catch (Throwable $e) {
  19. echo get_class($e) . ": " . $e->getMessage()."\n";
  20. }
  21. ?>
  22. ok
  23. --EXPECT--
  24. FFI\ParserException: Incomplete struct "X" at line 1
  25. ok
  26. ok