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