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
260
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
290
Introduction: PHP Extensions
thomasweinert
2
880
PCRE - Matching Patterns
thomasweinert
0
170
Controlling Arduino With PHP
thomasweinert
2
610
PCRE With PHP
thomasweinert
0
820
Controlling Arduino With PHP
thomasweinert
1
190
XPATH WITH PHP AND JS
thomasweinert
0
160
PHPUG CGN: Arduino With PHP
thomasweinert
0
160
IPC 2013: Controlling Arduino With PHP
thomasweinert
0
270
Other Decks in Programming
See All in Programming
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
280
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
380
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
160
React本体のコードリーディング
high_g_engineer
1
160
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
2
210
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
390
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
360
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
1.1k
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
580
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
210
Go 1.27 における memory allocation の高速化
andpad
0
320
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
180
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
Designing for Timeless Needs
cassininazir
1
450
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Side Projects
sachag
455
43k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
How STYLIGHT went responsive
nonsquared
100
6.2k
Navigating Team Friction
lara
192
16k
Statistics for Hackers
jakevdp
799
230k
Docker and Python
trallard
47
4.1k
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