- addslashes1: addslashes() vs. addcslashes()
- addslashes2: addslashes() vs. mysql_escape_string()
- array1: integer vs. string keys
- array2: arrays vs. variables
- array3: array_unique() vs. !isset() (integers)
- array4: array_push() vs. [] =
- array5: list () vs. [0]
- array6: set duplicates vs. !isset()
- array7: set unique vs. !isset()
- array8: array_diff() vs. ==
- array9: set immediately or later
- array_map1: array_map() vs. foreach
- array_map2: array_map() vs. array_walk()
- array_map3: array_walk() vs. array_walk_recursive()
- array_merge1: array_merge() vs. + (string keys)
- array_merge2: array_merge() vs. for (int keys)
- cast1: (int) vs. intval()
- cast2: (int) vs. settype()
- cast3: (bool) vs. !empty()
- cast4: (string) vs. interpolate
- cast5: (string) vs. concat
- cast6: concat (string) vs. not
- cast7: (array) vs. array()
- cast8: (array) vs. array()
- chr1: chr() v. literal
- chr2: chr() v. pack()
- chr3: ord() v. unpack() (str keys)
- chr4: ord() v. unpack() (int keys)
- chr5: pack() v. sprintf()
- classes1: single class vs. associative arrays
- classes2: many classes vs. associative arrays
- classes3: passing classes vs. arrays
- classes4: function vs. class method
- constants1: define constants vs. variables
- constants2: using constants vs. variables
- constants3: defined() vs. isset()
- constants4: redefine constant
- create_function1: create_function() vs. eval()
- create_function2: many create_function() vs. eval()
- create_function3: create_function() vs. func callback
- echo1: commas vs. concat on long strings
- echo2: commas vs. concat on short strings
- echo3: commas vs. interpolation on long strings
- echo4: commas vs. interpolation on short strings
- echo5: echo vs. ?>...<?php (static)
- echo6: echo vs. ?>...<?php (dynamic)
- echo7: commas vs. sprintf() on long strings
- echo8: commas vs. sprintf() on short strings
- equal1: == vs. === (fail, different types)
- equal2: == vs. === (different types with cast)
- equal3: == vs. === (fail, same types)
- equal4: == vs. === (pass, same types)
- equal5: === vs. strcmp() (fail)
- equal6: === vs. strcmp() (pass)
- errors1: generating notices vs. not
- errors2: error_reporting(0) vs. @
- errors3: Exceptions vs. return code (fail)
- errors4: Exceptions vs. return code (pass)
- errors5: ignoring notices vs. not
- exec1: exec() vs. shell_exec()
- exec2: system() vs. shell_exec()
- file1: file() vs. file_get_contents() (str)
- file2: file() vs. file_get_contents() (array)
- file3: file() vs. fgets() (array)
- foreach1: foreach reference reading
- foreach2: foreach reference writing
- foreach3: foreach $k => $dummy vs. array_keys()
- foreach4: foreach vs. while
- foreach5: foreach/range() vs. for
- foreach6: foreach writing ref vs. key
- foreach7: foreach key vs. no key
- foreach8: foreach vs. while (next())
- func1: fcall vs. not (non-trivial)
- func2: fcall vs. call_user_func()
- func3: fcall vs. call_user_func_array()
- func4: fcall vs. callback
- global1: global vs. $GLOBALS
- global2: global vs. local
- global3: global vs. static
- hash1: md5() vs. sha1()
- hash2: sha1() short vs. long
- if1: else if vs. elseif
- if2: if vs. ternary
- if3: nested ifs
- if4: if vs. switch
- include1: include vs. require
- include2: include vs. eval()
- include3: include vs. include_once
- include4: file_exists() vs. require
- include5: include_once vs. function_exists()
- math1: float vs. integer addition
- math2: float vs. integer multiplication
- math3: multiply vs. add
- math4: min()/max() vs. if
- math5: abs() vs. ternary
- mysql1: mysql_query() vs. mysqli_query()
- mysql2: prepared vs. unprepared statements
- mysql3: mysqli_query() vs. mysqli->query()
- mysql4: mysql_escape_string() vs. mysql_real_escape_string()
- mysql5: mysql_query() vs. PDO->exec()
- mysql6: prepared vs. unprepared statements (PDO)
- ob_start1: ob_start()/ob_get_contents() vs. concat
- ob_start2: ob_start() vs. not (no output)
- preg1: preg_replace() vs. str_replace()
- preg2: preg_replace() vs. stri_replace()
- preg3: preg_match() vs. strpos() (simple)
- preg4: preg_match() vs. strpos() (complex)
- preg5: preg_split() vs. explode()/str_replace()
- rand1: rand() vs. mt_rand()
- rand2: rand() more vs. less
- rand3: rand() vs. array_rand() (odd keys)
- rand4: rand() vs. array_rand() (seq keys)
- recurse1: recurison vs. not (trivial)
- recurse2: tail recurison
- socket1: stream_socket_client() vs. fsockopen()
- socket2: sockets blocking vs. not
- sqlite1: sqlite vs. mysql (simple)
- sqlite2: sqlite vs. mysql (less simple)
- sqlite3: sqlite_query() vs. sqlite_exec()
- strpos1: strstr() vs. strpos()
- strpos2: strncmp() vs. strpos() (long)
- strpos3: strncmp() vs. strpos() (short)
- strpos4: substr() vs. strpos() (long)
- strpos5: substr() vs. strpos() (short)
- strpos6: strpos()/strtolower() vs. stripos()
- strtr1: strtr() vs. str_replace() on long strings
- strtr2: strtr() vs. str_replace() on short strings
- strtr3: str_ireplace() vs. strtolower()
- substr1: substr($var, 5, 1) vs. {5}
- substr2: substr() negative vs. strlen()
- substr3: substr() on short vs. long strings
- urlencode1: urlencode() vs. rawurlencode()
- urlencode2: urlencode() vs. base64_encode()
- urlencode3: urlencode() vs. urldecode()