Performance between calling a Class property vs a Class method in PHP? -


i know not noticeable @ sake of learning, there overhead of calling class methods on calling class property show in example below $router->controller , $router->action ? please don't flame me premature optimization, trying learn more.

// using class property $router = new router($uri, $uri_route_map); $router->dispatch($router->controller, $router->action);  // using class methods instead $router = new router($uri, $uri_route_map); $router->dispatch($router->controller(), $router->action()); 

$router->controller accessing class property, reading variable.
$router->controller() calling function. calling function bound have more overhead reading variable, since function read variable.


Comments

Post a Comment

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

java - where to store the user credentials in an enterprise application(EAI)? -

java - netbeans "Please wait - classpath scanning in progress..." -