Tag Archives: 電腦語言

PHP 7.0 Is Showing Very Promising Performance Over PHP 5

PHP 7.0 Is Showing Very Promising Performance Over PHP 5, Closing Gap With HHVM

With PHP 7.0 RC2 having just been released, I’ve been testing it out thoroughly across a range of Linux systems at Phoronix. To the say the least, the performance claims made by PHP developers about the upcoming PHP7 release are very accurate: it’s pretty darn fast and about twice as fast as PHP 5.6. Here are some benchmarks I did on Ubuntu Linux x86_64 comparing the performance of PHP 7.0 RC2 to PHP 5.3/5.4/5.5/5.6, along with some HHVM results tossed in at the end.

http://www.phoronix.com/scan.php?page=article&item=php-70-rc2&num=1

PHP 7.0.0 RC 1 Released

PHP 7.0.0 RC 1 Released

The PHP development team announces the immediate availability of PHP 7.0.0 RC 1. This is the sixth pre-release of the new PHP 7 major series. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

THIS IS A DEVELOPMENT PREVIEW – DO NOT USE IT IN PRODUCTION!
PHP 7.0.0 RC 1 contains fixes for 27 reported bugs, and altogether over 200 commits with various stability improvements for database, array, assert, streams and other functionality.

PHP 7.0.0 comes with new version of the Zend Engine with features such as (incomplete list):

    • – Improved performance: PHP 7 is up to twice as fast as PHP 5.6

 

    • – Consistent 64-bit support

 

    • – Many fatal errors are now Exceptions

 

    • – Removal of old and unsupported SAPIs and extensions

 

    • – The null coalescing operator (??)

 

    • – Combined comparison Operator (<=>)

 

    • – Return Type Declarations

 

    • – Scalar Type Declarations

 

    – Anonymous Classes

http://php.net/archive/2015.php#id2015-08-21-1

Re-thinking Event Listeners – Because yes

Re-thinking Event Listeners – Because yes

結論:business logic 不要放 event listener,因為不能 reuse。例如「確認註冊電郵」這個功能,如果直接寫在的 event listener 裡頭,那麼就不能在「重新發送」裡 reuse 那些 code。
有寫 WordPress 的人習慣甚麼都放在 event listener (hook),這是個壞習慣啊。

http://mmoreram.com/blog/2015/08/20/re-thinking-event-listeners/