Skip to content

[FP] "Variable Function usage" suggests broken code #1986

@jdreesen

Description

@jdreesen
Subject Details
Plugin Php Inspections (EA Ultimate)
Language level PHP 8.1

Current behaviour

The "Variable Function usage" inspection suggests refactoring call_user_func_array to call_user_func which results in wrong code:
Image

After applying the suggestion, we get this, which doesn't work:
Image

Expected behaviour

The inspection should not be suggested when there is array/argument unpacking involved in-between.

Environment details

PhpStorm 2025.1.3
Build #PS-251.26927.60, built on June 24, 2025
Runtime version: 21.0.7+9-b895.130 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.8.0-62-generic
Ubuntu 24.04.2 LTS; glibc: 2.39
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 6144M
Cores: 16
Current Desktop: ubuntu:GNOME

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions