| Summary: | Variable call of static class function using colons | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Jos <yvhjhs> |
| Component: | PDT | Assignee: | PHP UI <php.ui-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | silviya, zhaozhongwei |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Set php version to 5.3 or later,you will not see the error. I confirm that the error shows for PHP5.1/5.2. Setting up for higher removes the error. Closing the issue. |
Build Identifier: 20090920-1017 I was developing a function to execute static functions for any class and function that I give it; so I instantiate the parameters (obviously) in variables; I didn't like to use call_user_func, then I decided to try with: /* * As example */ class my_class{ public static function my_function(){ echo "Hello world!!!"; return true; } } $class='my_class'; $function='my_function'; $result=$class::$function(); /* * Displays "Hello world!!!" and returns true. */ The PDT Editor marks it as syntax's error, but executing the code, the run was Ok. And for reasons of my workplace I can't to upload any code that the editor marks with any error. I expect you can give me a solution to include it to my local syntax checker, and at future to include it in the next versions. Sincerly, Jos. Thank you. Reproducible: Always Steps to Reproduce: 1. Create a class with a static function 2. Assign the classname and the static function name to variables 3. Use the syntax $my_class::$my_function