Download src/php/php-src/ext/ffi/tests/006.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 451 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/006.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/ffi/tests/006.phpt
-
curl -L -o 006.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/ffi/tests/006.phpt
451 Bytes
| --TEST-- | |
| FFI 006: Pointer assignment | |
| --EXTENSIONS-- | |
| ffi | |
| --INI-- | |
| ffi.enable=1 | |
| --FILE-- | |
| $ffi = FFI::cdef(); | |
| $v = $ffi->new("int*[2]"); | |
| $v[1] = $ffi->new("int[1]", false); | |
| $v[1][0] = 42; | |
| var_dump($v); | |
| FFI::free($v[1]); | |
| var_dump($v); | |
| --EXPECTF-- | |
| object(FFI\CData:int32_t*[2])#%d (2) { | |
| [0]=> | |
| NULL | |
| [1]=> | |
| object(FFI\CData:int32_t*)#%d (1) { | |
| [0]=> | |
| int(42) | |
| } | |
| } | |
| object(FFI\CData:int32_t*[2])#%d (2) { | |
| [0]=> | |
| NULL | |
| [1]=> | |
| NULL | |
| } | |