1--TEST--
2mysqli fetch user variable
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
8mysqli_check_skip_test();
9?>
10--FILE--
11<?php
12require_once dirname(__DIR__) . "/test_setup/test_helpers.inc";
13
14    $link = default_mysqli_connect();
15
16    mysqli_query($link, "SET @dummy='foobar'");
17
18    $stmt = mysqli_prepare($link, "SELECT @dummy");
19
20    mysqli_stmt_bind_result($stmt, $dummy);
21    mysqli_stmt_execute($stmt);
22    mysqli_stmt_fetch($stmt);
23
24    var_dump($dummy);
25
26    mysqli_stmt_close($stmt);
27    mysqli_close($link);
28    print "done!";
29?>
30--EXPECT--
31string(6) "foobar"
32done!
33