1--TEST-- 2Object instantiated without parentheses is collected 3--FILE-- 4<?php 5 6class A 7{ 8 public function test(): void 9 { 10 echo 'called' . PHP_EOL; 11 } 12 13 public function __destruct() 14 { 15 echo 'collected' . PHP_EOL; 16 } 17} 18 19new A()->test(); 20echo 'code after' . PHP_EOL; 21 22?> 23--EXPECT-- 24called 25collected 26code after 27