Implicit Evaluation with PHP

Implicit Evaluation with PHP Archives: Commentary

· previous page

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

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 […]

continue reading... » One Comment

31 July 2006

Keywords Compared to Functions

In programming, there are two language constructs. There are functions, both built-in and user-defined (thought built-in can always be user defined), and there are keywords. This makes sense– how could you define a function called “function”? Ignore the syntax problem…
function function ($args) { /* how to let code get in here??? */ }
As I realized […]

continue reading... » 0 Comments

6 July 2006

Tabs vs Spaces

This is a very interesting article about the functional difference between tabs and spaces when indenting code. The author argues that the problem today with using Tab to indent code is that tab is thought of in terms of a fixed number of spaces. Really, he argues, Tab should be treated as a delimiter, and […]

continue reading... » 0 Comments

12 April 2006

On Object Oriented Programming

There are three ways to program: functionally, procedurally, or object-oriented-aly. Any Turing-complete language will effectively let you use any of those types for development. Stereotypically, though, Scheme is a functional language, C is a procedural language, and Java is an object-oriented language.
For my own real-world use, I tend to use a hybrid procedural/OOP style. […]

continue reading... » 0 Comments

15 February 2006

Coroutines in C

A cool way do mutual recursion (sort of) in C by the author of PuTTY
Read more at www.chiark.greenend.org…

continue reading... » 0 Comments

7 February 2006

My Spam Traps

There are a number of things I do to limit my spam reception. They do a fair job: I’ve been using the same address for years and it hasn’t been spammed.
In short, I own the domain alternateinterior.com. I have a single catchall email address, so anything@alternateinterior.com ends up in my inbox. All of those emails […]

continue reading... » 0 Comments

15 December 2005

I Always Screw Up Some Mundane Detail

Most medium- or large-sized projects are multi-layered if not multi-tiered. There is an interface tier, a logic tier and a data tier. In an MVC-based application, the interface equates to the various views, the data tier is one component of the model and the logic is most of the controller. Building all the basic objects, […]

continue reading... » 0 Comments

· previous page