summaryrefslogtreecommitdiff
path: root/ext/ffi/tests/301-win32.phpt
blob: 7493399cafab749cc8a6a07b514fe45c69b54abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
FFI 301: FFI loading on Windows
--SKIPIF--
<?php require_once('skipif.inc'); ?>
<?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip for Windows only'); ?>
--INI--
ffi.enable=1
--FILE--
<?php
require_once('utils.inc');
$fn = __DIR__ . "/300-win32.h";
$cont = str_replace(
        "PHP_DLL_NAME",
        ffi_get_php_dll_name(),
        file_get_contents("$fn.in")
    );
file_put_contents($fn, $cont);

$ffi = FFI::load($fn);
$ffi->php_printf("Hello World from %s!\n", "PHP");
?>
--CLEAN--
<?php
	$fn = __DIR__ . "/300-win32.h";
	unlink($fn);
?>
--EXPECT--
Hello World from PHP!