Slide 1

Slide 1 text

Outside The Bubble A WordCamp talk by Tom J Nowell

Slide 2

Slide 2 text

Who Am I?

Slide 3

Slide 3 text

Defining The Bubble

Slide 4

Slide 4 text

What's Happening Inside?

Slide 5

Slide 5 text

What Happened Outside?

Slide 6

Slide 6 text

PHP 5.3, 5.4, & 5.5

Slide 7

Slide 7 text

Massive Performance Increases PHP 5.3 significantly faster than 5.2 PHP 5.4 up to 2x as fast in some benchmarks No code changes required

Slide 8

Slide 8 text

PSR-0 PSR-1 and PSR-2 Standards for PHP code: ● Standard code style ● Standard auto loaders & class conventions ● Standard logger interfaces ● Amongst others..

Slide 9

Slide 9 text

Namespaces Lambdas Closures Traits Generators Queues DoubleLinkedLists Heaps Stacks etc and more

Slide 10

Slide 10 text

Namespaces

Slide 11

Slide 11 text

Lambdas & Closures // Lambdas add_action( 'the_content', function( $content ){ return $content.'Final Note'; }); // Closures $note = 'Final Note'; add_action( 'the_content', function($content) use($note) { return $content.$note; }); // anonymous functions $func = function( $content ) { return $content.'the end'; }; add_action( 'the_content', $func );

Slide 12

Slide 12 text

Traits Requires PHP 5.4

Slide 13

Slide 13 text

Speaking of Singletons...

Slide 14

Slide 14 text

Generators

Slide 15

Slide 15 text

Queues, Stacks, Sets, PriorityQueues, Heaps & other SPL containers Special containers with performance and memory advantages over standard arrays

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

MySQL Removed

Slide 18

Slide 18 text

Replaced by PDO, MySQLi & ORMs e.g. Doctrine, Idiorm etc WordPress hasn't moved to support these and breaks in PHP 5.5

Slide 19

Slide 19 text

QA Tools

Slide 20

Slide 20 text

PHPLOC

Slide 21

Slide 21 text

PHP CodeSniffer Prevent common semantic errors, and highlight coding standards violations

Slide 22

Slide 22 text

PHP Mess Detector Takes a given PHP source code base and look for several potential problems within that source. These problems can be things like: ● Possible bugs ● Suboptimal code ● Overcomplicated expressions ● Unused parameters, methods, properties

Slide 23

Slide 23 text

SCheck & Facebook PHP tools ● Catch common mistakes such as: function add_hash( $color ) { return '#'.$colour; } addhash(); // missing '_' ● Generate databases describing your code structure for analysis ● View codebases in visual tools with Google Maps style panning and zoom, and search for functions and objects

Slide 24

Slide 24 text

phantm Static analyser to check type in PHP code amongst other things $dict = array(); $dict['en'] = array(); $dict['en']['fr'] = 'Bonjour'; $dict['en']['de'] = 'Hallo'; $dist['en']['it'] = 'Ciao'; $dict['en']['sp'] = 'Hola'; :7 Notice: Type mismatch: expected: Array[...], found: Top $dist['en']['it'] = 'Ciao';

Slide 25

Slide 25 text

Invasion of the MVC Frameworks

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Zend Framework

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Goutte A web client/scraping library require_once '/path/to/goutte.phar'; use Goutte\Client; $client = new Client(); $crawler = $client->request( 'GET', 'http://www.symfony-project.org/' ); $link = $crawler->selectLink('Plugins')->link(); $crawler = $client->click($link); $nodes = $crawler->filter('.error_list'); if ($nodes->count()){ die(sprintf("Authentication error: %s\n", $nodes->text())); }

Slide 34

Slide 34 text

Underscore.php

Slide 35

Slide 35 text

Assetic Asset management on steroids ● Handles all assets, js/css/images/less/sass/etc ● Generic filter system for compilation/compression/URL handling amongst other things ● Handles Caching & filesystem searches

Slide 36

Slide 36 text

Klein Superfast URL Router Library respond('GET', '/hello-world', function () { return 'Hello World!'; }); $klein->dispatch();

Slide 37

Slide 37 text

Dispatch A PHP 5.3 Micro framework

Slide 38

Slide 38 text

Twig Super fast templating engine My Webpage

My Webpage

{{ a_variable }}

Slide 39

Slide 39 text

Places To Find Out More PHPNW October, Manchester PHPUK February, London PHPNE April, Newcastle

Slide 40

Slide 40 text

Questions? Tom J Nowell @tarendai [email protected] www.tomjn.com