--- /dev/null
+--TEST--\r
+Bug #55653 PS crash with libmysql when binding same variable as param and out\r
+--SKIPIF--\r
+<?php\r
+require_once('skipif.inc');\r
+require_once('skipifconnectfailure.inc');\r
+?>\r
+--FILE--\r
+<?php\r
+ require_once("connect.inc");\r
+\r
+ if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {\r
+ printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());\r
+ }\r
+\r
+ $in_and_out = "a";\r
+\r
+ if (!($stmt = $link->stmt_init()))\r
+ printf("[002] [%d] %s\n", $link->errno, $link->error);\r
+\r
+ if (!($stmt->prepare("SELECT ?")) ||\r
+ !($stmt->bind_param("s", $in_and_out)) ||\r
+ !($stmt->execute()) ||\r
+ !($stmt->bind_result($in_and_out)))\r
+ printf("[003] [%d] %s\n", $stmt->errno, $stmt->error);\r
+\r
+ if (!$stmt->fetch())\r
+ printf("[004] [%d] %s\n", $stmt->errno, $stmt->error);\r
+\r
+ if ("a" !== $in_and_out)\r
+ printf("[005] Wrong result: '%s'\n", $in_and_out);\r
+\r
+ echo "done!";\r
+?>\r
+--EXPECT--\r
+done!
\ No newline at end of file