Volodymyr Panivko created THRIFT-5984:
-----------------------------------------

             Summary: Cache function_exists() capability checks in PHP runtime 
hot paths
                 Key: THRIFT-5984
                 URL: https://issues.apache.org/jira/browse/THRIFT-5984
             Project: Thrift
          Issue Type: Improvement
          Components: PHP - Library
            Reporter: Volodymyr Panivko


In `lib/php/lib/Serializer/TBinarySerializer.php` and 
`lib/php/lib/Transport/TSocket.php` the runtime calls `function_exists()` on 
every serialize / deserialize / open() — checking for the same C-extension and 
socket functions whose presence is a static property of the PHP installation.

Memoize these checks via `private static ?bool` flags initialized with the 
null-coalescing assignment operator (`??=`). One-time lookup per process, 
identical behavior.

Follow-up to THRIFT-5981 / THRIFT-5983 under the umbrella THRIFT-5960 (PHP 
modernization).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to