PHP - Moved: Variable Functions Overhead
This topic has been moved to Application Design.
http://www.phpfreaks.com/forums/index.php?topic=314334.0 Similar TutorialsI'm curious if anyone has information on how much overhead there is with creating an object in PHP. I've tried finding some benchmarks but haven't really been able to find anything solid to use for reference. Also, when dealing with objects what optimizations can be done to improve performance. I ask because my project I've been working on is entirely OO. Everything, including views, are objects (though their state and behaviour is really just the model they're representing and a show() function that has the HTML used to display the model). This makes development very easy and clean but I'm trying to figure out how much of a difference I can expect in production and in what ways I can limit any negative side effects. What things could be cached, and what things can't? For example, is it possible to cache the class definition without caching instances of that definition (since they'd be different from page view to pageview)? Would that be helpful. Any pointers would be great. I haven't had a lot of time with performance tweaking so I'm not sure of any known pitfalls. I know objects and function calls use a bit more overhead but I've never found out how much more. Thanks in advance. i have two functions. In function two it has $id=9. how do i get function one to echo $id? how do i adjust the below example to accomplish this? Code: [Select] $newdb = new Database(); class Database { function one() { $newdb->two(); echo $id; } function two() { $id = 9 return $id; } } hi very good, hi very good, I have a label on a form select and I get that value with $ _POST like this: $ _POST like this: $ gallery = array ($ _POST ['gallery']); and that value will put it he $ image = $ sitemap-> gallery [$ gallery] -> addChild ('image'); the problem is giving me error is as follows: Fatal error: Call to a member function addChild () on a non-object in I do not understand is that if I put a value directly asin me do it like so: $ gallery = 0; $ Image = $ sitemap-> gallery [$ gallery] -> addChild ('image'); I do well, what happens is that I want the user to choose, Kind of strange as it may fix. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=314249.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=345635.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=314136.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=312460.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=353775.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=326455.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=359149.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=343073.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=347224.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=346932.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=357370.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=342459.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=308673.0 This topic has used a waypoint to get to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=359489.0 How do I like it, you ask? Quite well. Besides the downtime Tuesday I haven't had any server problems, and the game itself is great. Very D2-esque but with very noticeable enhancements. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=357878.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=342929.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=350095.0 |