SlideShare a Scribd company logo
안정수
@findstar
내가 아는
Laravel Framework를
소개합니다.PHP7 으로 뛰어들기
안정수
Xpressengine 개발
PHP, Java, Objective-c, react.js
@findstar
발표자 소개
1. PHP7 is coming
2. Performance
3. New features
4. PHP 버전 이야기
5. Migration
목차
1. PHP7 is Coming
PHP 7 Is Coming
Are your Web Application Ready?
1-1. PHP7?
2015. 10월 PHP7이 나옵니다!
(현재 RC1)
PHP5.4
PHP5.5
PHP5.6
PHP6
PHP7
1-2. PHP6는 어디로 갔나요?
PHP6 는 없어요....
1-2. PHP6 망!
Unicode 지원등등..... 진행하다가 GG
1-3. PHP-NG(next generation)
PHP-NG : 원래 별도의 브랜치
=> 7.0 됨
주된 내용은 : PHP 리팩토링!
1-4. PHP7 internal?
Zend engine 3.0
Smaller data structures
Fewer allocations
Less indirection
1-5. ZVAL
PHP5 PHP7
ZVAL 32 bytes 16 bytes
HashTable 72 bytes 56 bytes
object 96 bytes 40 bytes
1-6. Memory management
Less heap, more stack
Redevelop a new heap and optimize
Cpu cache friendly
1-6. XE 에서 체험해보세요.
demo.xpressengine.com
2. Performance
3-1. Benchmark Test
XE1 - Board ab -k -c 50 -n 10000 http://xe1.app/
3-2. Benchmark Env
2012 mid Macbook Pro Retina
Vagrant Rasmus Image
3-3. Benchmark Result
0
30
60
90
120
PHP 5.4 PHP 5.5 PHP 5.6 PHP 7.0
-1.66% 2.21% 40.11%
Request / Sec
80.6 79.2 80.9
113.34
XE - 게시판 목록 benchmark
3-5. 공식 Benchmark 4.4 ~ 7.0
짧은게 좋은겁니다..
0.8 PHP 7.0
참고 링크
3-6.WP - XE
0
30
60
90
120
PHP 5.6 PHP 7.0
WP 4.2.4
XE WP 4.2.4
XE
40.11%
102.4%
Requests / Sec
3-7. Local Composer
composer create-project laravel/laravel
php 5.6 : Memory usage: 160.27MB (peak: 222.83MB)
php 7.0 : Memory usage: 121.91MB (peak: 170.53MB)
23.42% 감소
3-8.Wordpress
워드 프레스 사이트가 php7 으로 구동환경을 바꾸었더니
CPU 자원 사용율이 72% 감소함
3-9. 결론
PHP7 = php5.6
PHP7 = php5.0
X 2
X 14
Speeeeeeeeeeeeed UP!
참고 링크
3. New features in PHP7
PHP7
3-1. Scalar type
function add(int $a, int $b) {
return $a + $b
}
echo add(1, 2); // 3
echo add(1.2, 2); // 3
3-1. Scalar type
declare(strict_types=1);
function add(int $a, int $b) {
return $a + $b
}
echo add(1, 2); // 3
echo add(1.2, 2); // TypeException
3-2. Return type
function add(int $a, int $b) : int {
return $a + $b
}
echo add(1, 2);
3-3. Spaceship operator
echo 2 <=> 2; // 0
echo 2 <=> 3; // -1
echo 2 <=> 1; // 0
3-3. Spaceship operator
function compareValue($a, $b){
return ($a < $b ) ? -1 : ( ($a > $b ) ? 1 : 0 );
}
function compareValue2($a, $b){
return $a <=> $b;
}
3-4. Engine Exceptions
BaseException abstract
EngineException
ParseException
Exception
ErrorException
RuntimeException
fatals 대신 Exception
3-4. Engine Exceptions
class A {
public function t(){
return 't called';
}
}
$testa = new A();
echo $testa->aaa();
3-5. Group namespace
use BarLibBarFoo{
ClassA,
ClassB,
ClassC,
ClassD as FooFoo
};
3-6. Null Coalesce Operator
$username = isset($a)? $a :‘foo’;
$username = $a?? ‘foo’;
3-7. Closure::call
class Foo{
public $bar;
}
$foo = new Foo;
$foo->bar = 10;
$clo = function($a) {
print_r($this->bar + $a );
};
$clo->call($foo, 10);
3-8.Anonymous class
var_dump(new class(){});
object(class@anonymous)#1 (0) {
}
3-9. Non static method call
class A{
function foo() { var_dump($this); }
}
class B{
function bar(){ A::foo(); }
}
$b = new B;
$b->bar();
4.Version of PHP
4-1 PHP 버전 지원
5.3 5.4
4-2 PHP 5.3 …..
4-3 지금 PHP 5.3, 5.4 쓰시나요?
4-4 하늘이 무너져도..
4-4 배포판의 보안 지원
CentOS 5.x php 5.3 2017 년 3월
CentOS 6.x php 5.3 2020년 11월
CentOS 7.x php 5.4 2024년 6월
Ubuntu 10.04 LTS php 5.3 , 지원중단.
Ubuntu 12.04 LTS php 5.3 2017년 4월
Ubuntu 14.04 LTS php 5.5.9
4-5 요약
5.3 과 5.4 를 사용중이시라면
버전을 올리시는게 좋습니다.
5. Migration
MISSION MIGRATION
5-1. Migration
in PHP 7 Doctrines..
- Do not fall into a “Python2VS Python3” war
버전이 올라가도 하위 호한성을 유지합니다.
5-2. Removed
ereg
mssql
mysql
sybase_ct
aolserver, apache,
apache_hooks, apache2filter,
caudium, continuity
isapi, milter, nsapi,
phttpd, pi3web,
roxen, thttpd,
tux, webjames
Extensions SAPI
5-3. Removed
<% %>
<%=
<script language=php>
</script>
<? 와 <?= 는 없어지지 않습니다.
5-3. Removed
call_user_method()
call_user_method_array()
call_user_func()
call_user_func_array()
5-4. Deprecated
5-5. Migration
http://php.net/manual/en/migration70.php
5-6. Migration Assistant Report
https://github.com/Alexia/php7mar
끝
새로운 모습의 PHP7을 기대해 봅니다
참고
[php7]
http://php.net/manual/en/migration70.php
http://devzone.zend.com/4693/php-7-glance/
[slideshare]
http://www.slideshare.net/zymsys/new-in-php-7?related=2
http://www.slideshare.net/jpauli/php7-is-coming?next_slideshow=1
[php internal]
https://nikic.github.io/2015/05/05/Internal-value-representation-in-PHP-7-part-1.html
https://nikic.github.io/2015/06/19/Internal-value-representation-in-PHP-7-part-2.html
http://nikic.github.io/2014/12/22/PHPs-new-hashtable-implementation.html
[migration assistant report]
https://github.com/Alexia/php7mar

More Related Content

PDF
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
PDF
Java lambda
PPTX
Angular2 가기전 Type script소개
PPTX
Windows reversing study_basic_5
 
PDF
Javascript
PPTX
PHP 7의 새로운 특징과 기능 요약
PPT
헷갈리는 자바스크립트 정리
PDF
1.Startup JavaScript - 프로그래밍 기초
자동화된 소스 분석, 처리, 검증을 통한 소스의 불필요한 #if - #endif 제거하기 NDC2012
Java lambda
Angular2 가기전 Type script소개
Windows reversing study_basic_5
 
Javascript
PHP 7의 새로운 특징과 기능 요약
헷갈리는 자바스크립트 정리
1.Startup JavaScript - 프로그래밍 기초

What's hot (20)

PPTX
Jdk(java) 7 - 5. invoke-dynamic
PPTX
자바스크립트 기초문법~함수기초
PDF
Javascript 교육자료 pdf
PDF
일단 시작하는 코틀린
PDF
Java 이해하기 쉬운 코드 20210405
PPTX
자바스크립트 함수
PPTX
골때리는 자바스크립트 발표자료
PPTX
Clojure Chapter.6
PDF
[Kerference] 시작! 리버싱 - 김종범(KERT)
PPTX
0.javascript기본(~3일차내)
PPTX
4-1. javascript
PDF
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
PDF
JDK 변천사
PDF
스위프트, 코틀린과 모던언어의 특징 (Swift, Kotlin and Modern Languages)
PDF
자바8 람다식 소개
PDF
Javascript - Function
PPTX
Modern C++의 타입 추론과 람다, 컨셉
DOCX
Javascript 완벽 가이드 정리
PPTX
Angular2 router&http
PPTX
[KGC2014] 두 마리 토끼를 잡기 위한 C++ - C# 혼합 멀티플랫폼 게임 아키텍처 설계
Jdk(java) 7 - 5. invoke-dynamic
자바스크립트 기초문법~함수기초
Javascript 교육자료 pdf
일단 시작하는 코틀린
Java 이해하기 쉬운 코드 20210405
자바스크립트 함수
골때리는 자바스크립트 발표자료
Clojure Chapter.6
[Kerference] 시작! 리버싱 - 김종범(KERT)
0.javascript기본(~3일차내)
4-1. javascript
[C++ Korea 3rd Seminar] 새 C++은 새 Visual Studio에, 좌충우돌 마이그레이션 이야기
JDK 변천사
스위프트, 코틀린과 모던언어의 특징 (Swift, Kotlin and Modern Languages)
자바8 람다식 소개
Javascript - Function
Modern C++의 타입 추론과 람다, 컨셉
Javascript 완벽 가이드 정리
Angular2 router&http
[KGC2014] 두 마리 토끼를 잡기 위한 C++ - C# 혼합 멀티플랫폼 게임 아키텍처 설계
Ad

Similar to Introduce php7 (20)

PDF
Laravel 로 배우는 서버사이드 #3
PPTX
Startup JavaScript 8 - NPM, Express.JS
PDF
Modern PHP
PPTX
Java8 람다
PDF
Whatischef korean
PDF
What is chef - korean
PDF
파이썬2.7 기초 공부한 것 정리
PDF
Java tutorial
PDF
EcmaScript6(2015) Overview
PDF
Node.js at OKJSP
PDF
Ryu with OpenFlow 1.3, REST API
PDF
스칼라와 스파크 영혼의 듀오
PPTX
PHP Slim Framework with Angular
PDF
[TECHCON 2019: MOBILE - Android]2.예제에서는 알려주지 않는 Model 이야기
PDF
Create-React-App으로 SSR을 구현하며 배운 점 (feat. TypeScript)
PPTX
Node.js and react
PDF
[A1]루비는 패셔니스타
PPTX
[114]angularvs react 김훈민손찬욱
PDF
키트웍스_발표자료_김경수functional_programming240920.pdf
PDF
Front-end Development Process - 어디까지 개선할 수 있나
Laravel 로 배우는 서버사이드 #3
Startup JavaScript 8 - NPM, Express.JS
Modern PHP
Java8 람다
Whatischef korean
What is chef - korean
파이썬2.7 기초 공부한 것 정리
Java tutorial
EcmaScript6(2015) Overview
Node.js at OKJSP
Ryu with OpenFlow 1.3, REST API
스칼라와 스파크 영혼의 듀오
PHP Slim Framework with Angular
[TECHCON 2019: MOBILE - Android]2.예제에서는 알려주지 않는 Model 이야기
Create-React-App으로 SSR을 구현하며 배운 점 (feat. TypeScript)
Node.js and react
[A1]루비는 패셔니스타
[114]angularvs react 김훈민손찬욱
키트웍스_발표자료_김경수functional_programming240920.pdf
Front-end Development Process - 어디까지 개선할 수 있나
Ad

Introduce php7