When using a separate process to run tests, the ReflectionClass used to create new instances seems to be serialized by PHPUnit, issuing an exception:
PHPUnit\Framework\Exception: Fatal error: Uncaught Exception: Serialization of 'ReflectionClass' is not allowed in Standard input code:80
Stack trace:
#0 Standard input code(80): serialize(Array)
#1 Standard input code(111): __phpunit_run_isolated_test()
#2 {main}
thrown in Standard input code on line 80
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
When using a separate process to run tests, the ReflectionClass used to create new instances seems to be serialized by PHPUnit, issuing an exception: