Implicit Evaluation with PHP Archives: August 2006
·
29 August 2006
PHP Parsing HTML
One of the higher level items I seem to deal with frequently is HTML parsing. The primary reason that HTML gets elected as a data format over something like CSV is that it’s easy to style. CSV lacks any formatting at all. XLS is beautiful, but essentially impossible to parse without a COM friendly language, […]
continue reading... » 0 Comments
23 August 2006
Official Introspection, Reflect and Implicit Evaluation PHP.net resources
PHP.net actually provides documentation for each of these topics, but finding it can prove difficult. The following is a collection of the links I’ve discovered.
PHP5 Reflection Classes: These are explicit reflection methods specific to PHP5. I’ve never used them.
Object introspection functions: Introspection functions. There are slight differences in some between PHP4 and PHP5.
Zend Debugger Extensions: […]
continue reading... » 0 Comments
21 August 2006
Variable representation in PHP
In PHP, I like to think each function has its own Dictionary/Hash to manage its scope and that code outside of functions is actually part of a “Main” function. I think of it as a dictionary because through implicit evaluation, you can create variables with spaces and other reasons you’ll see at the conclusion of […]
continue reading... » 0 Comments
17 August 2006
Using HTML as a Template
There are roughly three ways I can think of offhand to do templating in PHP.
HTML Tags with PHP to populate values
PHP Functions to generate tags including values
Special markup to do one or more of the above
There are relatively concrete examples of each. Any new programer, and even some experienced programmers use method 1. Indications of […]
continue reading... » 0 Comments
16 August 2006
On Getting Older
It was bound to happen.
I was reflecting on yesterday’s introspection article. And I laughed. It wasn’t many years ago that I would have just rolled my eyes on hearing the word introspection. “So what?” was my attitude. And yet now it’s important enough to write about it.
I went through the same transformation with regards to […]
continue reading... » 0 Comments
15 August 2006
Introspection in PHP
There are two object-oriented functions which I seem to use most when doing any kind of implicit evaluation coding. They are get_object_vars doc and get_class_vars doc. Get_Object_Vars and Get_Class_Vars are very similar in what they do. Given a particular class or object, it will return an array of the variables and their values in that […]
continue reading... » 0 Comments
1 August 2006
Eval Preformance
I’ve always assumed implicit evaluation was faster than eval, but today, I finally tested that. Eval is four times slower than implicit evaluation.
// Eval Sample
$var = 1;
for ($x = 0; $x < 100000; $x++) {
eval (”$w$var=$var++;”);
}
// Implicit Sample
$var = 1;
for ($x = 0; $x < 100000; $x++) {
$strVar = ‘w’ . $var;
$$strVar = $var++;
}
Each sample […]
continue reading... » 0 Comments
1 August 2006
History of the World, Part XII: Wherein Java covers its eyes and proclaims “You Can’t See Me!”
It astounds me, that Sun could consider implementing method delegates in Java and then reject it. While functionally, inner/anonymous classes (which Sun suggests) are equivalent to an instance method (Like the .net languages use) the example Sun conveys this message with shows just how impractical it really is. In place of a clear, straight-forward method, […]
continue reading... » 0 Comments
1 August 2006
PHP Server Security
I was reading Rasmus’s famous OOP/Procedural [MVC]* Article and came across this tidbit.
My standard production server Apache config always has:
<Files *.inc>
deny from all
</Files>
Naming them .php instead and letting people browse them directly can be a much bigger problem since they are now being executed out of context. So you need to either put your include […]

