Most likely it's the resultset, due to mysqlnd driver (this is my article about PDO, but it's applicable for mysqli as well).
To solve, you have to add
MYSQLI_USE_RESULT parameter to mysqli_query(),
$result = mysqli_query(self::$cn, 'SELECT * FROM `' . $table . '`', MYSQLI_USE_RESULT);
Also, move your
SHOW CREATE TABLE query above SELECT, as you cannot run other queries while an unbuffered query is active.