Slide 1

Slide 1 text

echo `An introduction to PHP`;

Slide 2

Slide 2 text

echo `An introduction to PHP`; echo `7 reasons why it’s yucky`;

Slide 3

Slide 3 text

echo `First, the good parts`; var_dump([ `Web’s most popular server lang`, `Incredibly easy to deploy`, `WordPress, uber popular framework`, `Templating is built-in` ]);

Slide 4

Slide 4 text

echo `Problem #1`; echo `Templating is built-in`; foreach($arr as $el) { echo `

`; echo doSomeMysteriousThing($el); echo `

`; }

Slide 5

Slide 5 text

echo `Problem #2`; echo `It can be very inconsistent`; echo 'hello \nworld'; // hello \nworld echo "hello \nworld"; // hello // world

Slide 6

Slide 6 text

echo `Problem #3`; echo `Everything is a function!!!`; array_push($arr, `abc`); // 5.3 array_key_exists($arr, `abc`); // bool $r = array_merge($arr, [`abc`]); $r = array_map(`func`, $arr); $r = count($arr);

Slide 7

Slide 7 text

echo `Problem #4`; echo `Equality is unequal`; `6` == ` 6` // true `133` == `0133` && 133 != 0133; // true `foo` == 0 && `foo` == true; // true NULL < -1 && NULL == 0; // true

Slide 8

Slide 8 text

echo `Problem #5`; echo `Scope is weird...`; if (1 === 1) { $v = `if`; } function a() { $v = `a`; } function b() { global $v; $v = `b`; } a(); echo $v; // `if` b(); echo $v; // `b`

Slide 9

Slide 9 text

echo `Problem #6`; echo `Debugging is terrible!`; echo $arr; // `Array` print_r($arr); // Array ( [0] => 1 [1] var_dump($arr); // array(4) { [0]=> int( var_dump(debug_backtrace());

Slide 10

Slide 10 text

echo `Problem #7`; echo `Documentation is terrible`; echo ($documentation == $forum); // 1

Slide 11

Slide 11 text

echo `In the end...`;

Slide 12

Slide 12 text

echo `In the end...`; echo `...it doesn’t matter that much`; $u = `http://blog.codinghorror.com/`; $u .= `php-sucks-but-it-doesnt-matter`; echo $u;