Autowiring in PHP refers to the ability to automatically resolve dependencies of a class without the need for manual instantiation or injection of dependencies.To implement autowiring in PHP using the ReflectionClass, you can follow these steps:

Step 1. Define the class that has dependencies that need to be autowired:

class MyTestingClass
{
    /**
     * @var DependencyClass 
     */
    private DependencyClass $dependency;
    
    /**
     * @param DependencyClass $dependency
     */
    public function __construct(DependencyClass $dependency)
    {
        $this->dependency = $dependency;
    }
}

Step 2. Create a method that uses ReflectionClass to get the constructor of the class and resolve its dependencies:

/**
 * @throws ReflectionException
 */
function resolveDependencies($className)
{
    $reflection = new ReflectionClass($className);
    $constructor = $reflection->getConstructor();
    $dependencies = [];
    
    if ($constructor) {
        foreach ($constructor->getParameters() as $param) {
            $dependency = $param->getClass();
            if ($dependency) {
                //Use recursion to autowire nested dependencies
                $dependencies[] = resolveDependencies($dependency->getName());
            }
        }
    }
    
    return $reflection->newInstanceArgs($dependencies);
}

Step 3. Call the resolveDependencies() function with the name of the class that needs autowiring:

$instance = resolveDependencies('MyTestingClass');

This will create an instance of ExampleClass with its dependency automatically resolved using autowiring. This approach assumes that all dependencies can be instantiated using their default constructor. If any of the dependencies require additional arguments to be passed to their constructor, you will need to modify the resolveDependencies() function accordingly.

ReflectionClass is very powerful tool and it can help you not only to autowire dependencies, but for validating data in a very easy way.

For more on this look into these posts:

How to validate input data in Symfony using DTOs

Using DTOs in PHP Symfony