æ¢åã¢ããªãPHP7ã¸ç§»è¡ããåã«ããã¹ã6ã¤ã®ãã¨
PHP 7.0.0-RC6 ããªãªã¼ã¹ãããPHP7ã®æ£å¼ãªãªã¼ã¹ãè¿«ã£ã¦ãã¾ãï¼äºå®ã§ã¯2015/11/12ï¼ãä»æ¥ã¯ãæ¢åã¢ããªã®PHP7ã¸ã®ç§»è¡ã«ã¤ãã¦æ´çãã¦ããã¾ãã
ï¼2015-12-04 追è¨ï¼ 12/3ï¼æ¥æ¬æéã§ã¯12/4ã®æ©æï¼ã«PHP 7.0.0ã æ£å¼ã«ãªãªã¼ã¹ ããã¾ããã
æ¢åã¢ããªãPHP7ã«ç§»è¡ããåã«ã¯ä»¥ä¸ãå®æ½ããã¨ããã§ãã
- ãã¹ãç°å¢ãæ§ç¯ãã
- æ¡å¼µã¢ã¸ã¥ã¼ã«ã®å¯¾å¿ç¶æ³ã調ã¹ã
- ã©ã¤ãã©ãªãªã©ã®å¯¾å¿ç¶æ³ã調ã¹ã
- å¤æ´ç¹ã«é¢ããããã¥ã¡ã³ããèªã
- php7ccãããã
- ã³ã¼ããä¿®æ£ããã¹ããã
6ã¤ããã¦ã¾ãããçµå±ã¯PHP7ã§ããã¹ããããã¨ãããã¨ã«å°½ãã¾ãã
ãã¹ãç°å¢ãæ§ç¯ãã
PHP7ã®å®è¡ç°å¢ããªããã°å§ã¾ãã¾ãããVagrantãªã©ã§ãã¹ãç°å¢ãæ§ç¯ã§ãã¾ããæ¢ãã°è²ã ããã¨æãã¾ããã1ã¤ã ãç´¹ä»ããã¨ããã°ãRasmusããã®php7devã§ããããã
åèï¼PHP7ã®ãã¹ãç°å¢ãæ§ç¯ããããã®å°ãã ãé·ãéã®ã
(2015-11-30 追è¨) ãPHP7ã®éçºç°å¢ãVagrantï¼CentOS7ä¸ã«30åã§æ§ç¯ããããæ¸ãã¾ããã
ã¾ããCentOSç°å¢ããã§ã«ããå ´åã¯ãRemiã®RPMããã§ã«ããã¾ãã®ã§ãããã使ãã®ãç°¡åã§ãããã
ãã¹ãç°å¢ãç¨æã§ããããPHPã®ãã¼ã¸ã§ã³ã確èªãã¾ãããã
vagrant@php7dev:~/php-src$ php -v
PHP 7.0.1-dev (cli) (built: Oct 29 2015 10:14:58) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
ãªããæ¬çªç°å¢ã®ç§»è¡ã®åã«ã¯ãæ¬çªç°å¢ã¨åãç°å¢ã®ã¹ãã¼ã¸ã³ã°ç°å¢ã§ãã¹ããã¦ãã ããã
æ¡å¼µã¢ã¸ã¥ã¼ã«ã®å¯¾å¿ç¶æ³ã調ã¹ã
PHP5ç¨ã®æ¡å¼µã¢ã¸ã¥ã¼ã«ï¼ã¨ã¯ã¹ãã³ã·ã§ã³ï¼ã¯PHP7ã§ã¯åä½ãã¾ããã
PHPæ¬ä½ã«å«ã¾ããªãæ¡å¼µã¢ã¸ã¥ã¼ã«ã使ã£ã¦ããå ´åã¯ã対å¿ç¶æ³ã確èªããå¿ è¦ãããã¾ãã
対å¿ç¶æ³ãã¾ã¨ãã¦ããããã¸ã§ã¯ãã以ä¸ã«ããã¾ãã
ãã®æ¡å¼µã¢ã¸ã¥ã¼ã«ãPHP7対å¿ãã¦ãããã©ãããæ大ã®åé¡ããç¥ãã¾ããã
ããã«å¼ã£ãããä¾ã¨ãã¦ãPhalconãªã©ã®æ¡å¼µã¢ã¸ã¥ã¼ã«ã®ãã¬ã¼ã ã¯ã¼ã¯ãããã¾ãã
Phalconã«ã¤ãã¦ã¯ã2.xç³»ã¯Zephirã¨ããæ¡å¼µã¢ã¸ã¥ã¼ã«ã®ã³ã¼ããçæããè¨èªã§ä½æããã¦ãããZephirãPHP7対å¿ããå¿ è¦ãããã¾ãã
Zephirã®PHP7対å¿ã¯åæ段éã§ãããã¾ã å®æã¯ãã¦ãã¾ããã
(2015-12-10 追è¨) Phalconã®PHP7ã¸ã®å¯¾å¿ç¶æ³ã¯
ãåç §ãã¦ãã ããã
ã©ã¤ãã©ãªãªã©ã®å¯¾å¿ç¶æ³ã調ã¹ã
ï¼PHPã§æ¸ãããï¼ã©ã¤ãã©ãªããã¬ã¼ã ã¯ã¼ã¯ãPHP7ã«å¯¾å¿ãã¦ããªããã°ã
- ï¼ããã°ï¼å¯¾å¿ãããã¼ã¸ã§ã³ã«ã¢ããã°ã¬ã¼ããã
- èªåã§å¯¾å¿ããã
- å¥ã®å¯¾å¿ããã©ã¤ãã©ãªã«å ¥ãæ¿ãã
ã®ãããããé¸æããå¿ è¦ãããã¾ãã
ãã¬ã¼ã ã¯ã¼ã¯ã®å¯¾å¿ç¶æ³ã¯ãã¾ãã¡ãããã¥ãããã®ãããã¾ããã
ãã¬ã¼ã ã¯ã¼ã¯ | ãã¼ã¸ã§ã³ | ç¶æ³ |
---|---|---|
BEAR.Sunday | 1.0 | 対å¿æ¸ã¿ |
CakePHP | 3.1.5 | 対å¿ï¼CakePHP 3.1.5 Releasedï¼ |
2.7以é | 対å¿ï¼ãã ããString ã¯ã©ã¹ã使ã£ã¦ããå ´åã¯CakeText ã¯ã©ã¹ã«ç½®æãå¿
è¦ |
|
CodeIgniter | 3.0 | å¯¾å¿ |
FuelPHP | 1.8-devï¼1.7.4以éï¼ | 対å¿ããã ããError ã¯ã©ã¹ãã«ã¹ã¿ãã¤ãºãã¦ããå ´åã¯Errorhandler ã¯ã©ã¹ã«å¤æ´ãå¿
è¦ |
Symfony | ã¡ã³ãããã¦ãããã¼ã¸ã§ã³ | 対å¿æ¸ã¿ï¼Symfony achieves 100% PHP7 compatibilityï¼ |
Yii | 2.0 | 対å¿ï¼PHP 7 releasedï¼ |
1.1.17以é | 対å¿ï¼PHP 7 releasedï¼ |
ãªããPEARã«ã¤ãã¦ã¯ã1.10.0ã§å¯¾å¿ãã¦ãã¾ãã
ã©ã¤ãã©ãªããã¬ã¼ã ã¯ã¼ã¯ã対å¿ãã¦ããããã¨ãã£ã¦å®å¿ãã¦ã¯ããã¾ãããåé¡ã¯ã¢ããªã対å¿ãã¦ãããã©ããã§ãã
å¤æ´ç¹ã«é¢ããããã¥ã¡ã³ããèªã
ã¾ãèªãã¹ãã¯PHPããã¥ã¢ã«ã§ããå ¨é¨èªã¿ã¾ãããã
æ¢åã¢ããªã§çµæ§å¼ã£ããããããªã®ãã¯ã©ã¹åã®è¡çªã§ããåå空éã使ã£ã¦ãªãã¨è¡çªã®å¯è½æ§ããããè¡çªãããã¢ããªãä¿®æ£ããããããã¾ããã以ä¸ã使ããªãã¯ã©ã¹åã®ä¸è¦§ã§ãã
使ããªããªã£ãã¯ã©ã¹å
- bool
- int
- float
- string
- NULL
- TRUE
- FALSE
å°æ¥ä½¿ããªããªãã¯ã©ã¹å
- resource
- object
- mixed
- numeric
æ°ããã¯ã©ã¹åï¼ã¤ã¾ãã¦ã¼ã¶å®ç¾©ã§ããªãï¼
- IntlChar
- ReflectionGenerator
- ReflectionType
- SessionUpdateTimestampHandlerInterface
- Throwable
- Error
- TypeError
- ParseError
- AssertionError
- ArithmeticError
- DivisionByZeroError
次ã«èªãã¹ãã¯ãPHP 7.0 UPGRADE NOTESã§ããPHPããã¥ã¢ã«ãããç´°ãããã¨ãè¨è¼ããã¦ãã¾ããå¿ è¦ã«å¿ãã¦èªã¿ã¾ãããã
php7ccãããã
次ã«PHP 7 Compatibility Checkerãããã¾ãã
(2015-12-04 追è¨) php7cc以å¤ã«ããPHP 7 Migration Assistant Report (MAR)ãã¨ããã®ãããã¾ããã
ããã§ã¯ãphp7ccãComposerããã¤ã³ã¹ãã¼ã«ãã¾ãã
$ composer global require sstalle/php7cc
以ä¸ã®ããã«å®è¡ãã¾ãã--extensions
ãªãã·ã§ã³ã§æ¡å¼µåãæå®ã§ãã¾ãã
$ php7cc --extensions=php,ini fuel/core/
é¤å¤ããããã©ã«ããããå ´åã¯ã--except
ãªãã·ã§ã³ã§æå®ãã¾ãã
$ php7cc --except=vendor --except=core/tests fuel/
ä¸è¨ã§ã¯ãfuel/vendor
ã¨fuel/core/tests
ãã©ã«ããé¤å¤ããã¾ãã
ä¾ãã°ã以ä¸ã®ãããªã¬ãã¼ããåºåããã¾ãã
File: /home/vagrant/fuel-1.8-dev/fuel/core/vendor/phpseclib/Net/SSH2.php
> Line 1734: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
...
File: /home/vagrant/fuel-1.8-dev/fuel/core/classes/database/mysql/result.php
> Line 23: Removed function "mysql_num_rows" called
mysql_num_rows($result);
> Line 30: Removed function "mysql_free_result" called
mysql_free_result($this->_result);
> Line 36: Removed function "mysql_data_seek" called
mysql_data_seek($this->_result, $offset);
> Line 62: Removed function "mysql_fetch_object" called
mysql_fetch_object($this->_result);
> Line 67: Removed function "mysql_fetch_object" called
mysql_fetch_object($this->_result, $this->_as_object);
> Line 72: Removed function "mysql_fetch_assoc" called
mysql_fetch_assoc($this->_result);
...
File: /home/vagrant/fuel-1.8-dev/fuel/core/classes/database/query/builder/insert.php
> Line 96: Function argument(s) returned by "func_get_args" might have been modified
func_get_args();
...
File: /home/vagrant/fuel-1.8-dev/fuel/core/classes/session.php
> Line 72: Check that callbacks that are passed to "session_set_save_handler" and return false or -1 (if any) operate correctly
session_set_save_handler(function ($savePath, $sessionName) {
}, function () {
}, function ($sessionId) {
$_SESSION = \Session::get();
$_SESSION['__org'] = $_SESSION;
}, function ($sessionId, $data) {
$org = isset($_SESSION['__org']) ? $_SESSION['__org'] : array();
unset($_SESSION['__org']);
if ($remove = array_diff_key($org, $_SESSION)) {
\Session::delete(array_keys($remove));
}
empty($_SESSION) or \Session::set($_SESSION);
}, function ($sessionId) {
\Session::destroy();
}, function ($lifetime) {
});
File: /home/vagrant/fuel-1.8-dev/fuel/packages/orm/classes/model/nestedset.php
> Line 812: Possible array element creation during by-reference assignment
$tracker[$index] =& $tree[$this->{$pk}];
> Line 867: Possible array element creation during by-reference assignment
$tracker[$index + 1] =& $tracker[$index]->_custom_data[$children][$treenode->{$pk}];
> Line 871: Possible array element creation during by-reference assignment
$tracker[$index + 1] =& $tracker[$index][$children][$treenode->{$pk}];
Checked 375 files in 26.485 seconds
ã³ã¼ããä¿®æ£ããã¹ããã
php7ccã§å ±åãããç¹ã確èªãã¤ã¤ãå¿ è¦ãªãã³ã¼ããä¿®æ£ãããã¹ããã¦ãã ããã
vagrant@php7dev:~/fuel-1.8-dev$ php oil test
Tests Running...This may take a few moments.
PHPUnit 5.0.8 by Sebastian Bergmann and contributors.
............................................................... 63 / 389 ( 16%)
............................................................... 126 / 389 ( 32%)
............................................................... 189 / 389 ( 48%)
............................................................... 252 / 389 ( 64%)
............................................................... 315 / 389 ( 80%)
............................................................... 378 / 389 ( 97%)
........... 389 / 389 (100%)
Time: 653 ms, Memory: 14.00Mb
OK (389 tests, 483 assertions)
ããã¥ã¡ã³ãããã¦ããªããã°ã¨æãããåä½ãããããã°ãhttps://bugs.php.net/ ã調ã¹ã¦ãå ±åããªããã°ã¨ãããããã°å ±åãã¾ãããã
Rasmusããã®æã
PHPã«ã³ãã¡ã¬ã³ã¹ã§Rasmusããã¯ãèªåã¯æ¬çªç°å¢ã«PHP 7.0.0ã¯ä½¿ããªãã¨è¨ã£ã¦ãã¾ããããããã7.1ã¾ã§å¾ ã¤å¿ è¦ã¯ãªãã¨ãã
åè
- https://wiki.php.net/todo/php70
- PHP7調æ»(33)ã«ã¹ã¿ã ã»ãã·ã§ã³ãã³ãã©ã®è¿ãå¤ã®æå³ãå¤æ´ - Qiita
- PHP7ã§ããã¯ãã¬ã¼ã¹ãå°ãå¤ãã£ã¦ãã
- PHP5.6ããPHP7ã«ã¢ããã°ã¬ã¼ããã¦å®éã«ã¯ã¾ã£ãç¹9å · DQNEOèµ·æ¥æ¥è¨
- PHP7ã§å¤ããã㨠- hnwã®æ¥è¨
Date: 2015/10/30