Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[VarExporter] Lazy proxy breaks pass by reference arguments #49191

Copy link
Copy link
Closed
@magnetik

Description

@magnetik
Issue body actions

Symfony version(s) affected

6.2.x

Description

When using Symfony 6.2 and the var exporter lazy proxy, if you generate a proxy for \Redis the proxy looks like this:

class MyRedisProxy extends \Redis {
	
    public function sscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null)
    {
        return parent::sscan(...\func_get_args());
    }
	
}

See the iterator passed by reference? It seems that when used with func_get_args the reference get lost or something.

How to reproduce

As a consequence this code :

$myProxy = new MyRedisProxy();

$myProxy->connect('127.0.0.1', 6379);

$cursor = null;
while (($result = $myProxy->sScan('key_', $cursor, null, 1000)) !== false) {
	var_dump($result);
}

it an infinite loop.

Repro with VarExporter : https://github.com/magnetik/repro-symfony-proxy-break-reference

Possible Solution

No response

Additional Context

No response

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.