+ All Categories
Home > Engineering > Php 7.x 8.0 and hhvm and

Php 7.x 8.0 and hhvm and

Date post: 16-Feb-2017
Category:
Upload: pierre-joye
View: 78 times
Download: 0 times
Share this document with a friend
59
PHP 7, 8 ,HHVM & CO OCTOBER 13, 2016 PHP Conference Manila Pierre Joye
Transcript
Page 1: Php 7.x 8.0 and hhvm and

PHP 7, 8 ,HHVM & CO

OCTOBER 13, 2016PHP Conference ManilaPierre Joye

Page 2: Php 7.x 8.0 and hhvm and

Pierre Joye@[email protected]://www.slideshare.net/pierrej

PHP Core developerOSS dev

Portability fan

Page 3: Php 7.x 8.0 and hhvm and

hiring@BKK

dev – devops - sysops

Page 4: Php 7.x 8.0 and hhvm and

stats

Page 5: Php 7.x 8.0 and hhvm and

contribute.

Page 6: Php 7.x 8.0 and hhvm and

https://edit.php.net

Page 7: Php 7.x 8.0 and hhvm and

What‘s new in PHP worlds?

Page 8: Php 7.x 8.0 and hhvm and

Awesome new extension installer

https://github.com/FriendsOfPHP/pickle

Page 9: Php 7.x 8.0 and hhvm and

RFCshttps://wiki.php.net/

rfc

Page 10: Php 7.x 8.0 and hhvm and

Release Process RFChttps://wiki.php.net/rfc/

releaseprocess

Page 11: Php 7.x 8.0 and hhvm and

Lifecycle

Page 12: Php 7.x 8.0 and hhvm and

PHP 5.32009 - 2014

Page 13: Php 7.x 8.0 and hhvm and

PHP 5.42012 - 2015

Page 14: Php 7.x 8.0 and hhvm and

PHP 5.52013 - 2016

Page 15: Php 7.x 8.0 and hhvm and

January 2017: security fixes onlyPHP 5.6

Page 16: Php 7.x 8.0 and hhvm and

5.6.26

Page 17: Php 7.x 8.0 and hhvm and

5 + 1 = 7

Page 18: Php 7.x 8.0 and hhvm and

6.6.6

Page 19: Php 7.x 8.0 and hhvm and

7.0.11

Page 20: Php 7.x 8.0 and hhvm and

7.1Future is now

Page 21: Php 7.x 8.0 and hhvm and

7.0 - speed++

Page 22: Php 7.x 8.0 and hhvm and

lies, damned lies & benchmarks

Page 23: Php 7.x 8.0 and hhvm and
Page 24: Php 7.x 8.0 and hhvm and
Page 25: Php 7.x 8.0 and hhvm and

PHP 7.0FEATURES

Page 26: Php 7.x 8.0 and hhvm and

■Rewamped Engine■True 64bit support■Large string and LFS (Large file support)■Consistent variables syntax■Error exception instead of fatal error■Scalar type declarations■Zero cost asserts

Page 27: Php 7.x 8.0 and hhvm and

■Secure RNG■PHP4 constructors deprecated■JIT enabled PCRE■Removed ext/mysql, ext/ereg and more■New ?? and spaceship operators■New JSON parser■Many other features, a lot already target

7.1

Page 28: Php 7.x 8.0 and hhvm and

PHP 7.1FEATURES

Page 29: Php 7.x 8.0 and hhvm and

■Multiple Exception types catch■Http/2 Push support■Class constant visibility■Improved return types (void and more)■Allow custom keys for list(“foo“, “bar“)■Warning about invalid strings in arithmetic ops■Many more features

Page 30: Php 7.x 8.0 and hhvm and

PHPSPECIFICATIONS

https://github.com/php/php-langspec

Page 31: Php 7.x 8.0 and hhvm and

OPEN & PUBLIC SPECIFICATIONS

COMPETIONS++

Page 32: Php 7.x 8.0 and hhvm and
Page 33: Php 7.x 8.0 and hhvm and
Page 34: Php 7.x 8.0 and hhvm and

FOCUS ON SPEED (MOST)

Page 35: Php 7.x 8.0 and hhvm and
Page 36: Php 7.x 8.0 and hhvm and

SPEED IS NOT SCALE

Page 37: Php 7.x 8.0 and hhvm and

STEROID++

Page 38: Php 7.x 8.0 and hhvm and

What is scale?

Page 39: Php 7.x 8.0 and hhvm and

SO?

Page 40: Php 7.x 8.0 and hhvm and
Page 41: Php 7.x 8.0 and hhvm and
Page 42: Php 7.x 8.0 and hhvm and

<?php class OilPaintFilter {

/** @var int32 */ public $levels = 25;/** @var int32 */ public $filterSize = 5;/** * @engine qb * * @param image $dst * @param image $src * * @local float32[*][r,g,b,a] $bin * @local float32 $max_intensity * @local int32 $(current_index|max_index) * @local int32 $(filter_x|filter_y|filter_offset) * @local int32 $(x|y|x_limit|y_limit) * @local int32 $(width|height) * @local float32[r,g,b,a] $pixel * @local float32 $multiplier */public function filter(&$dst, $src) {…

Page 43: Php 7.x 8.0 and hhvm and

QB<?php function calc($n, &$a) {

$b = 18;while($n) {

$a = $b * $b * $b * $b;$n--;

}}$n = 5000000;$a = 0;calc($n, $a); $end = microtime(true);

Page 44: Php 7.x 8.0 and hhvm and

QB

Source: http://php-qb.net/index.php/2-uncategorised/27-comparing-performance-in-qb-with-hhvmSee http://benchmarksgame.alioth.debian.org/u32/performance.php?test=spectralnorm or other

Page 45: Php 7.x 8.0 and hhvm and

ZEPHIR

Page 46: Php 7.x 8.0 and hhvm and

Optimization & code generation

Compilation + optimization

Native execution

Page 47: Php 7.x 8.0 and hhvm and

namespace MyLibrary; class Filter {public function alpha(string str) {

char ch;string filtered = "";for ch in str {

if (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') {

let filtered .= ch;}

} return filtered; }}

Page 48: Php 7.x 8.0 and hhvm and

<?php $filter = new MyLibrary\Filter();echo $filter>alpha("01he#l.lo?/1");

Page 49: Php 7.x 8.0 and hhvm and

PHP8

Page 50: Php 7.x 8.0 and hhvm and

https://github.com/zendtech/php-src/tree/jit-dynasm/ext/opcache/jit

Page 51: Php 7.x 8.0 and hhvm and

20% speedup on bench.php

Page 52: Php 7.x 8.0 and hhvm and

PHP Alternative Implementations

Page 53: Php 7.x 8.0 and hhvm and
Page 54: Php 7.x 8.0 and hhvm and
Page 55: Php 7.x 8.0 and hhvm and

Tagua VMRust based PHP Implemetation

https://github.com/tagua-vm/tagua-vm

Page 56: Php 7.x 8.0 and hhvm and

Future

■Extend PHP using php (à la hhvm)■Go, Rust, .net extensions

Page 57: Php 7.x 8.0 and hhvm and

Resources

■ http://wiki.php.net/rfc/■ http://zephir-lang.com/■ http://www.slideshare.net/ircmaxell/high-performance-php-phpnw■ http://talks.php.net/fluent15#/■ https://github.com/google/recki-ct■ http://blog.ircmaxell.com/2014/08/introducing-recki-ct.html■ https://github.com/chung-leong/qb/wiki/Introduction

Page 58: Php 7.x 8.0 and hhvm and

Resources

■ https://edit.php.net/■ https://wiki.php.net/rfc/phpng■ https://wiki.php.net/rfc/abstract_syntax_tree■ http://hhvm.com/blog/6323/the-journey-of-a-thousand-bytecodes■ https://github.com/php/php-src/blob/master/UPGRADING■ https://github.com/php/php-src/blob/master/UPGRADING.INTERNALS

Page 59: Php 7.x 8.0 and hhvm and

Resources

■ http://phpdbg.com/■ http://windows.php.net/qa/■ http://qa.php.net/■ http://ongr.io■ http://aka.ms/AzureCodeManiac2015


Recommended