Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Will PHP __autoload() function really affect performance?

IntroductionRegarding to PHP performance, the most frequently discussed is the __autoload() function. Many people say that this function will affect the performance very much, some other people say that opcode will affect __autoload() as well. So we will have some tests on these two.EnvironmentPHP 5.3.9 -- Launch under fastcgi modeNginx 1.1.12eAccelerator 0.9.6.1ScreenshotsLaunch pageeAccelerator(In php.ini) configurationFile structure(each Test file has over 6000 lines of code)Testing With eAccelerator cache and with __autoload() function loadedThe result after refreshing the web browserTotal...

3,792 1       PHP PERFORMANCE __AUTOLOAD() OPCODE


  Latest PHP patch cannot fix the bug

On Wednesday(2012-05-02), a remote code execution vulnerability in PHP was accidentally exposed to the Web, prompting fears that it may be used to target vulnerable websites on a massive scale. The bug itself was traced back to 2004, and came to light during a recent CTF competition.A CERT advisory on the flaw explains: “When PHP is used in a CGI-based setup (such as Apache's mod_cgid), the php-cgi receives a processed query string parameter as command line arguments which allows command-line switches, such as -s, -d or -c to be passed to the php-cgi binary, which can be exploited to dis...

15,559 0       PHP BUG PATCH BYPASSED


  Using JSON in PHP

Currently JSON has become one of the most popular data exchange formats. Many website APIs support it. Since PHP 5.2, PHP provides json_encode() and json_decode() method to handle JSON encoding and decoding.1. json_encode()This function is used to transform array and objects to JSON format. First let's look one array example.        $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);   echo json_encode($arr);the result is{"a":1,"b":2,"c":3,"d":4,"e":5}We look one example of object transformation.      ...

15,451 1       PHP JSON JSON_DECODE(0 JSON_ENCODE()


  Install LAMP in two easy steps

You might have seen my earlier post related to installing PHP, Apache and MySQL on UBUNTU 11.10. That process contains number of steps and some lengthy commands which we can not remember easily.After good comments from Gaurav and Coward I have managed to get that lengthy process in just 2 steps. So I thought its great to share with all readers to they can get benefit as well.Before starting make sure that you have root user’s access to perform the sudo action. So now let...

4,158 0       PHP TUTORIAL LAMP STEPS


  How to send asynchronous requests in PHP

It’s easy to make asynchronous calls in PHP with just a little bit of HTTP header knowledge and some library code around PHP sockets.This technique is useful when posting requests to your own server for bits of logic you’d like to run in the background.  If you don’t control the endpoint, you might not be comfortable with some of the limitations, such as the inability to read anything from the response.  So, you couldn’t post data to a webservice and receive an HTTP 200 OK response and certainly not an ID for an object newly created by the serv...

7,842 0       PHP SOCKET ASYNCHRONOUS REQUEST


  PHP Sucks! But I Like It!

I read a rather interesting post yesterday called PHP: a fractal of bad design. It's been getting a lot of traffic among the PHP community lately because it's rather inflammatory. But to be honest, it does make a lot of really good points. It also makes a lot of mistakes and misses a bigger picture.A Few MistakesThe post makes quite a few mistakes and odd apples to oranges comparisons. Let me point out the major ones that I saw.No Debugger - PHP has xdebug which works quite well as an interactive debugger.Lack Of Threading - This is true, but he lists it as a difficulty, and I list it as ...

19,069 0       PHP LIKE BAD DESIGN


  PHP: a fractal of bad design

PrefaceI’m cranky. I complain about a lot of things. There’s a lot in the world of technology I don’t like, and that’s really to be expected—programming is a hilariously young discipline, and none of us have the slightest clue what we’re doing. Combine with Sturgeon’s Law, and I have a lifetime’s worth of stuff to gripe about.This is not the same. PHP is not merely awkward to use, or ill-suited for what I want, or suboptimal, or against my religion. I can tell you all manner of good things about languages I avoid, and all manner of b...

18,499 3       PHP DESIGN ANALYSIS


  40+ Techniques to enhance your php code

1. Do not use relative paths , instead define a ROOT pathIts quite common to see such lines :1require_once('../../lib/some_class.php');This approach has many drawbacks :It first searches for directories specified in the include paths of php , then looks from the current directory.So many directories are checked.When a script is included by another script in a different directory , its base directory changes to that of the including script.Another issue , is that when a script is being run from cron , it may not have its parent directory as the working directory.So its a good idea to have absol...

4,145 0       PHP EFFICIENCY QUIRK TRICK TECHNIQUES