Skip to main content

Posts

Showing posts from 2014

mod_rewrite vs CNAME changes

I thought I could be smart and redirect to a google sites project, instead of changing the CNAME entries. I had to learn that a mod_rewrite to a different url always does a visible redirect to the substituted url, so no faking that it's not a google site.

PHP Opcodes

First, what is an Opcode? It's a compiled form of a PHP script, similar to Java bytecode. Or, more precisely, from php.net "When parsing PHP files, Zend Engine 2 generates a series of operation codes, commonly known as "opcodes", representing the function of the code." <?php $a = "Hello "; $b = "World\n"; echo $a . $b; For a script like this, the opcodes look like that: number of ops: 5 compiled vars: !0 = $a, !1 = $b line # * op fetch ext return operands --------------------------------------------------------------------------------- 2 0 > ASSIGN !0, 'Hello+' 3 1 ASSIGN !1, 'World%0A' 4 2 CONCAT ~2 !0, !1 3 ECHO ~2 5