Create an instance without calling constructor of the class

Code
<?php

class Foo
{
    private $iterator;
    
    public function __construct(array $array)
    {
        $this->iterator = new ArrayIterator($array);
    }
    
    public function getIterator()
    {
        return $this->iterator;
    }
}

$reflection = new ReflectionClass('Foo');
$foo = $reflection->newInstanceWithoutConstructor();

dump($foo->getIterator());

// Actually, Foo needs an iterator instead of an array to be injected,
// but if you can't change the class interna:
$array = [
    'OneValue',
    'TwoValue',
    'Three',
    'FourValue',
    'Five',
];
$iterator = new RegexIterator(
    new ArrayIterator($array),
    '/Value$/'
);

$prop = $reflection->getProperty('iterator');
// make private propery accessible for reflection
$prop->setAccessible(true);
$prop->setValue($foo, $iterator);

echo get_class($foo->getIterator());
Result
^ null

RegexIterator
Used Versions
PHP 8.3, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8