Download src/php/php-src/ext/ffi/tests/015.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.56 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/015.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ffi/tests/015.phpt
-
curl -L -o 015.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/015.phpt
1.56 kB
| --TEST-- | |
| FFI 015: Incomplete type usage | |
| --EXTENSIONS-- | |
| ffi | |
| --INI-- | |
| ffi.enable=1 | |
| --FILE-- | |
| try { | |
| FFI::cdef("struct DIR; static struct DIR dir;"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; static struct DIR *ptr;"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; typedef struct DIR DIR; static DIR dir;"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; typedef struct DIR DIR; static DIR *ptr;"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; static struct DIR foo();"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; static struct DIR* foo();"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; static void foo(struct DIR);"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct DIR; static void foo(struct DIR*);"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| ok | |
| --EXPECT-- | |
| FFI\ParserException: Incomplete struct "DIR" at line 1 | |
| ok | |
| FFI\ParserException: Incomplete struct "DIR" at line 1 | |
| ok | |
| ok | |
| ok | |
| ok | |
| ok | |
| ok | |