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
250
3
Share
Modern PHP
Overview of tools and language concepts
Thomas Weinert
October 29, 2014
More Decks by Thomas Weinert
See All by Thomas Weinert
Build Automation with Phive and Phing
thomasweinert
0
280
Introduction: PHP Extensions
thomasweinert
2
870
PCRE - Matching Patterns
thomasweinert
0
170
Controlling Arduino With PHP
thomasweinert
2
600
PCRE With PHP
thomasweinert
0
800
Controlling Arduino With PHP
thomasweinert
1
190
XPATH WITH PHP AND JS
thomasweinert
0
150
PHPUG CGN: Arduino With PHP
thomasweinert
0
160
IPC 2013: Controlling Arduino With PHP
thomasweinert
0
260
Other Decks in Programming
See All in Programming
CSC307 Lecture 17
javiergs
PRO
0
240
LLM Plugin for Node-REDの利用方法と開発について
404background
0
110
OSもどきOS
arkw
0
160
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.2k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
220
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
5
690
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
6
1.2k
分析エージェント精度向上における データアナリストの役割
oura_shoya
0
120
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
220
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
850
今さら聞けないCancellationToken
htkym
0
200
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
380
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
230
Abbi's Birthday
coloredviolet
2
7.7k
The Curse of the Amulet
leimatthew05
1
12k
New Earth Scene 8
popppiees
3
2.3k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
260
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
WCS-LA-2024
lcolladotor
0
600
KATA
mclloyd
PRO
35
15k
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