“In this article we’ll treat a quite simple argument but if badly managed can lead to big problems, the topic is the inclusion of files.
According to my experience I established three golden rules that should be enough; if you come up with other ones, I’ll be glad to talk about it….”
Tag Archives: News
PHP Tips – Manage correctly file inclusion
CONFIRMED: Facebook Gets Faster, Debuts Homegrown PHP Compiler
Mike Melanson write on readwriteweb.com “The rumors have been flying over what’s going on over at Facebook headquarters. The word has been that a PHP team was brought in and made to sign non-disclosure agreements before discussing a PHP project that has been in development for the past two years. Alex Handy, senior editor of the Software Development Times Blog, predicted last Saturday that Facebook “has rewritten the PHP runtime from scratch,” and several sources have confirmed for us tonight that Facebook has indeed been making some changes to the basic PHP runtime environment.
According to our sources, Facebook has been working on a PHP compiler that will
increase speed by around 80% and offer a just-in-time (JIT) compilation engine that will offer a number of advantages. The project is very similar to Google’s Unladen Swallow project, which rebuilt the Python compiler, boosting the speed fivefold and opening the door for multi-language integration.”

Anonymous functions now available from PHP 5.3
Anonymous functions, also known as closures, allow the creation of functions which have no specified name. They are most useful as the value of callback parameters, but they have many other uses.
Example:
2
3
4
{
echo "My name is $name";
};
Or you can use it as callback like javascript
2
3
4
5
6
7
8
9
10
11
12
"first_name" => "Garry",
"last_name" => "Lachman",
"age" => "27"
);
$callback_function = function ($field, $field_value)
{
echo "$field = $field_value";
};
array_walk($arr, $callback_function);
Using variables out function scope
2
3
4
5
6
7
8
9
10
11
12
13
14
$arr = array(
"first_name" => "Garry",
"last_name" => "Lachman",
"age" => "27"
);
$callback_function = function ($field, $field_value) use ($prefix)
{
echo "$prefix $field = $field_value";
};
array_walk($arr, $callback_function);
Have fun boys & girls