Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Modern PHP
Search
Thomas Weinert
October 29, 2014
Programming
3
220
Modern PHP
Overview of tools and language concepts
Thomas Weinert
October 29, 2014
Tweet
Share
More Decks by Thomas Weinert
See All by Thomas Weinert
Build Automation with Phive and Phing
thomasweinert
0
220
Introduction: PHP Extensions
thomasweinert
2
830
PCRE - Matching Patterns
thomasweinert
0
130
Controlling Arduino With PHP
thomasweinert
2
560
PCRE With PHP
thomasweinert
0
720
Controlling Arduino With PHP
thomasweinert
1
150
XPATH WITH PHP AND JS
thomasweinert
0
120
PHPUG CGN: Arduino With PHP
thomasweinert
0
140
IPC 2013: Controlling Arduino With PHP
thomasweinert
0
230
Other Decks in Programming
See All in Programming
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
230
レガシープロジェクトで最大限AIの恩恵を受けられるようClaude Codeを利用する
tk1351
2
1.1k
Dart 参戦!!静的型付き言語界の隠れた実力者
kno3a87
0
210
kiroでゲームを作ってみた
iriikeita
0
180
実践 Dev Containers × Claude Code
touyu
1
240
Portapad紹介プレゼンテーション
gotoumakakeru
1
130
Claude Codeで実装以外の開発フロー、どこまで自動化できるか?失敗と成功
ndadayo
2
1.3k
STUNMESH-go: Wireguard NAT穿隧工具的源起與介紹
tjjh89017
0
380
あのころの iPod を どうにか再生させたい
orumin
2
2.5k
ゲームの物理
fadis
5
1.5k
Terraform やるなら公式スタイルガイドを読もう 〜重要項目 10選〜
hiyanger
13
3.2k
Infer入門
riru
4
1.6k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Done Done
chrislema
185
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Designing for humans not robots
tammielis
253
25k
Transcript
MODERN PHP TOOLS & CONCEPTS @Thomas Weinert
TOOLS
IDES Eclipse Komodo Netbeans PHPStorm ...
VCS GIT Subversion
COLLABORATION Bitbucket GitHub Sourceforge
GITLAB
COMPOSER { "name": "carica/chip", "type": "library", "license": "MIT", "require": {
"php": ">=5.4", "carica/firmata": "dev-master" }, "require-dev": { "phake/phake": "1.*" }, "autoload": { "psr-4": { "Carica\\Chip\\": "src\\" } } }
PACKAGIST
SATIS
PHAR
PHPUNIT Ide Integration Mockery Phake Prophecy
BEHAT PHPSPEC
PHING
DEBUGGER Xdebug PHPDbg
PROFILER Xdebug XHProf
CODE QUALITY
phpdepend phpmd phpcpd phploc
PHP METRICS http://halleck45.github.io/PhpMetrics/
SCRUNTINIZER CI https://scrutinizer-ci.com/
SENSIOLABSINSIHGT https://insight.sensiolabs.com
ENGINES PHP (Zend Engine) PHPNG HHVM
ZEPHYR http://zephir-lang.com 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; } }
ZEPHYR http://zephir-lang.com $filter = new MyLibrary\Filter(); echo $filter->alpha("01he#l.lo?/1");
PHP-CPP http://www.php-cpp.com/ Php::Value my_plus(Php::Parameters ¶meters) { return (int)parameters[0] + (int)parameters[1];
}
FEATURES
NAMESPACES PSR-4
ANONYMOUS FUNCTIONS $board ->activate() ->done( function () use ($board, $loop)
{ $pin = $board->pins[13]; $pin->mode = Firmata\Board::PIN_MODE_OUTPUT; $loop->setInterval( function () use ($pin) { $pin->digital = !$pin->digital; }, 1000 ); } );
CALLABLE $_ = FluentDOM::create(); $_->formatOutput = true; echo $_( 'ul',
['class' => 'navigation'], $_('li', $_->cdata('FluentDOM')) );
TRAITS namespace Carica\Io\Event\Loop { use Carica\Io\Event; trait Aggregation { private
$_eventLoop = NULL; public function loop(Event\Loop $loop = NULL) { if (NULL !== $loop) { $this->_eventLoop = $loop; } elseif (NULL === $this->_eventLoop) { $this->_eventLoop = Factory::get(); } return $this->_eventLoop; } } }
PASSWORD API password_hash() password_verify() password_needs_rehash() password_get_info()
OPCACHE
DATETIME / DATETIMEIMMUTABLE
EXT/INTL
MYSQLND
SYNTAX
ARRAYS function()[key] $array = [1, 2, 3]
GENERATORS function xrange($start, $limit, $step = 1) { for ($i
= $start; $i <= $limit; $i += $step) { yield $i; } }
::CLASS $object::CLASS CLASSNAME::CLASS
CONSTANT EXPRESSION const SECONDS = self::DAYS * 86400
VARIADICS function f($req, $opt = null, ...$params) { printf( '$req:
%d; $opt: %d; number of params: %d'."\n", $req, $opt, count($params) ); } f(1); f(1, 2); f(1, 2, 3);
ARGUMENT UNPACKING function add($a, $b, $c) { return $a +
$b + $c; } $operators = [2, 3]; echo add(1, ...$operators);
THANKS