Force PHP’s Garbage Collector to Hold On to an Object?

  garbage-collection, httpclient, php, symfony

Is there a way to force PHP’s garbage collector to hold on to an object for a bit longer than it normally would? I’m pretty sure there’s not an official, public API for this (prove me wrong), but I’m wondering if there’s known science for indirectly influencing the garbage collector.

The larger issue I’m trying to solve is this bit of strange behavior where Symfony HttpClient won’t handle HTTP Requests asynchronously if you don’t store the result objects in a variable that’s local to your function/method.

Source: Symfony Questions