Archive for the 'PHP Development' Category

Adventures in Parsing: PHP’s implicit semicolon (‘;’) before every close tag

Simply put, every time you enter a PHP closing tag, the interpreter automatically adds a semicolon to end the current statement before switching to HTML mode. ┬áIn general, this is fairly innocuous, and it might even seem like the interpreter is doing you a favor, since now you can omit semicolons just before the end […]

Tuesday, January 29th, 2013

The importance of ZVals and Circular References

Just a quick post for now. Do you know how PHP’s symbol table works? To put it in nutshell, symbols are stored in one place and values (also called ZVals) are stored in another. Normally, this abstraction will mean nothing to you, but take the following sample code: $foo = &$bar; $bar = &$foo;$foo = […]

Wednesday, April 27th, 2011

PHP Quirks – String manipulation by offset

Just a quick update for a mild PHP Quirk/annoyance I have noticed recently while doing some manipulation of strings by character offset. Say you have a string, such as ‘abcde’; Now, suppose you want to check the value of the third character (at index 2). You might have done something like this: $str = ‘abcde’; […]

Wednesday, April 27th, 2011

Let’s talk about your password model

This entire article is obviated by the password_hash family of functions. Please check out password_hash() and friends for information on the up-to-date and correct way to handle passwords. Generally speaking, if you are using another method, it is wrong. More specifically, if you are using another method, and it is not based on crypt(), or […]

Tuesday, February 9th, 2010