Skip to content

Second parameter of mysqli_fetch_all throws error, while being totally valid #549

@ohartl

Description

@ohartl

In some old code i am trying to improve the following, completely valid call (in procedural style), get interpreded by phpstan as an error. (see http://php.net/manual/de/mysqli-result.fetch-all.php) However in the object oriented style it does work as expected.

This seems like an error doesn't it? If so i will propose a pull request. Maybe related to #527

<?php // foo.php

$result = new mysqli_result();
$rows = mysqli_fetch_all($result, MYSQLI_ASSOC);
phpstan analyse asd/foo.php
 ------ ------------------------------------------------------------------
  Line   foo.php
 ------ ------------------------------------------------------------------
  4      Function mysqli_fetch_all invoked with 2 parameters, 1 required.
 ------ ------------------------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions