Innovate faster and cut risk with PHP experts from Zend Services.
Explore Services
See How Zend Helps Leading Hosting Providers Keep Their Managed Sites on Secure PHP
Read More
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Explore Training
Submit support requests and browse self-service resources.
Explore Support
PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
We don't recommend addressing it if you don't have a robust automated test suite. This incompatibility doesn't prevent your application from functioning.
Should you decide to fix it, beware of methods being called using call_user_func, the method name being composed using concatenation, or any other case that might make the method references hard to detect automatically.
call_user_func
We have even observed an environment where an external Java application was reading the PHP tests and relied on the __test prefix. A change in that situation would have caused severe repercussions on the customer's pipeline, despite having no impact on the PHP code.
class Validation { function __existsUserName($userName) { } } $validation = new Validation(); foreach ($rules as $rule) { $functionName = '__' . $rule . 'UserName'; call_user_func(array($validation, $functionName), array($userName)); }
class Validation { function existsUserName($userName) { } } $validation = new Validation(); foreach ($rules as $rule) { $functionName = $rule . 'UserName'; call_user_func(array($validation, $functionName), array($userName)); }
Increase security and cut risk by simplifying PHP application upgrades and migrations.
Long Term Support buys organizations time to migrate.