Download src/php/php-src/ext/ffi/tests/028.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/028.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ffi/tests/028.phpt
-
curl -L -o 028.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/028.phpt
1.27 kB
| --TEST-- | |
| FFI 028: Incomplete arrays inside structure | |
| --EXTENSIONS-- | |
| ffi | |
| --INI-- | |
| ffi.enable=1 | |
| --FILE-- | |
| try { | |
| FFI::cdef("struct _x {int a; int b[0];};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct _x {int a; int b[];};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct _x {int a[0]; int b;};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct _x {int a[]; int b;};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("struct _x { struct {int a; int b[];}; int c;};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| try { | |
| FFI::cdef("union _x {int a; int b[];};"); | |
| echo "ok\n"; | |
| } catch (Throwable $e) { | |
| echo get_class($e) . ": " . $e->getMessage()."\n"; | |
| } | |
| --EXPECT-- | |
| ok | |
| ok | |
| ok | |
| FFI\ParserException: Flexible array member not at end of struct at line 1 | |
| FFI\ParserException: Flexible array member not at end of struct at line 1 | |
| FFI\ParserException: Flexible array member in union at line 1 | |