xref: /PHP-8.3/ext/ffi/tests/301-win32.phpt (revision bd9f4fa6)
1--TEST--
2FFI 301: FFI loading on Windows
3--EXTENSIONS--
4ffi
5--SKIPIF--
6<?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip for Windows only'); ?>
7--INI--
8ffi.enable=1
9--FILE--
10<?php
11require_once('utils.inc');
12$fn = __DIR__ . "/300-win32.h";
13$cont = str_replace(
14        "PHP_DLL_NAME",
15        ffi_get_php_dll_name(),
16        file_get_contents("$fn.in")
17    );
18file_put_contents($fn, $cont);
19
20$ffi = FFI::load($fn);
21$ffi->php_printf("Hello World from %s!\n", "PHP");
22?>
23--CLEAN--
24<?php
25	$fn = __DIR__ . "/300-win32.h";
26	unlink($fn);
27?>
28--EXPECT--
29Hello World from PHP!
30