mysqli::$protocol_version

mysqli_get_proto_info

Returns the version of the MySQL protocol used

&reftitle.description;

&style.oop;

`int` `mysqli->protocol_version`

&style.procedural;

`int` `mysqli_get_proto_info` `mysqli` `mysql`

Returns an integer representing the MySQL protocol version used by the connection represented by the `mysql` parameter.

&reftitle.parameters;

&mysqli.link.description;
&reftitle.returnvalues;

Returns an integer representing the protocol version.

&reftitle.examples;

### `$mysqli->protocol_version` example

&style.oop;

    <?php

    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    $mysqli = new mysqli("localhost", "my_user", "my_password");

    /* print protocol version */
    printf("Protocol version: %d\n", $mysqli->protocol_version);

&style.procedural;

    <?php

    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
    $link = mysqli_connect("localhost", "my_user", "my_password");

    /* print protocol version */
    printf("Protocol version: %d\n", mysqli_get_proto_info($link));

&examples.outputs;

    Protocol version: 10

&reftitle.seealso;

- `mysqli_get_host_info`