Hi David,
TCO modifies the call stack, which means features relying on it are not reliable any more, e.g. debug_backtrace, stack trace of an exception, etc. As a result, ES6 only ask to enable TCO in strict mode, which dropped support for func.arguments and func.caller. PHP don't have similar concept yet. In addition, if you check the compatibility for TCO, you will realize only safari provides support for it now.
Regards,
CHU Zhaowei
-----Original Message-----
From: David Rodrigues david.proweb@gmail.com
Sent: Sunday, April 28, 2019 2:48 AM
To: PHP Internals internals@lists.php.net
Subject: [PHP-DEV] TCO: Tail Call Optimization
Not long ago I heard about the Tail Call Optimization from ES6. It seemed
obscure to me at first, but once I understood the benefit of having it, it
seemed like a good idea of optimization for PHP to avoid recursion problems.
Is there any plan to make it possible in the engine?
David Rodrigues