getCancellation(); } $combinedToken = new CompositeCancellation(...$tokens); if (!$firstMemoryMeasure && $i > self::LOOP_COUNT / 2) { // Warmup and store first memory usage after 50% of iterations $firstMemoryMeasure = \memory_get_usage(true); } // Remove tokens from memory unset($combinedToken); delay(0.001); // Tick loop to allow resources to be freed. // Asserts if ($firstMemoryMeasure > 0) { self::assertLessThanOrEqual($firstMemoryMeasure, \memory_get_usage(true)); } } } }