<?php

namespace tests\mocks;

final class ExampleClassWithArgs
{
    private $constructorArgs = [];

    public function __construct()
    {
        $this->constructorArgs = func_get_args();
    }

    public function getConstructorArgs()
    {
        return $this->constructorArgs;
    }
}

<?php

namespace tests\mocks;

final class ExampleClassWithArgs
{
    private $constructorArgs = [];

    public function __construct(...$constructorArgs)
    {
        $this->constructorArgs = $constructorArgs;
    }

    public function getConstructorArgs()
    {
        return $this->constructorArgs;
    }
}

Use variadic function instead of func_get_args()
Use variadic function instead of func_get_args()
