Skip to content

CurlHttpClient crashes with Undefined variable: active #32833

Closed
@melkamar

Description

@melkamar

Symfony version(s) affected: 4.3.3 (this does not happen in 4.3.2)

Description

Freshly updated to 4.3.3 and my tests started crashing with notice Undefined variable: active.

Turns out the issue is in this line which was added recently.

If I declare $active=NULL; before passing it to curl_multi_exec(), the notice goes away.

Now, even PHP documentation uses a code example where the $active variable is undefined when passed into the function. Based on some more reading I believe that PHP should not raise a notice when an undefined variable is being passed into a function as a reference, but that is for some reason happening to me.

How to reproduce

  • Set up PHPUnit with convertNoticesToExceptions = "true"
  • Run PHPUnit KernelTestCase, execute a request and invoke KernelTestCase::ensureKernelShutdown().

Possible Solution

Initialize the $active variable before passing in to a function.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions