If you would like to use same PHP code to handle both AJAX and non-AJAX requests, here is a quick and simple trick that you can use to check if the incoming request is AJAX. For our trick we will use a HTTP header called HTTP_X_REQUESTED_WITH. It is supported by all modern browsers that support AJAX. Therefore, it should work in 99% of cases.Continue reading
Posts Tagged with "php"
Some exciting and promising coming changes in PHP 6 or 7 have been anounced recently by Dmitry Stogov from Zend. A detailed article has been postd here http://news.php.net/php.internals/73888.
Briefly, Zend is working on PHP NG (next generation) which will bring better performance and better memory management. According to Dmitry, the PHP application execution typically takes a significant part of the execution time dealing with memory allocations, and that affects PHP performance significantly as well.
I spent a significant amount of time experimenting with JIT, and even created a PoC of transparent LLVM based JIT compiler embedded into OPCache. The results on bench.php was just amazing – (0.219 seconds against 2.175 – *10 times speedup of PHP 5.5*), but on real-life apps we got just few percent speedup., - says Dmitry in his report.
According to his tests PHP developers can gain up to 20% more requests per second (in case with Wordpress for example).
So far it looks like upgrading to PHP NG should be painless (that's the idea). However, some of PHP extensions wil might require some "massage".
Looking forward to test the new PHP 6. Or maybe 7? ;)
For those who is looking for a good alternative for XAMMP or WAMP web server stacks. There is a very good option called AMPPS!
The listed number of provided features is impressive. Unlike the other solutions Ampps comes with over 300 PHP web applications, over 1000 PHP classes and libraries including Joomla!, WordPress, Magento, Dolphin and more.
Very easy to install and manage services with the administration panel. You can easily switch PHP versions with only one-click action.
One thing to notice though... Despite the fact that there are several versions of PHP included, you cannot switch MySQL version which, to be honest, I don't find too critical.
Server configuration is also very straightforward using the web panel. If you mess up the configuration, you can reset it to default state which might be useful sometimes. :)
Also it is very easy to update! The app has built-in updater which makes life way easier when it comes to update Ampps.