why do i love and hate php?
TRANSCRIPT
![Page 1: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/1.jpg)
W H Y D O I L O V E A N D H AT E P H P ?ŁU K A S Z C H R UŚC I E L
/291
![Page 2: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/2.jpg)
– FA B I E N P O T E N C I E R
„People hate PHP as a Language People like PHP as a Platform”
/292
![Page 3: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/3.jpg)
Silex
Twig
PHP-CS-FIXER
Pimple/293
![Page 4: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/4.jpg)
T H I S G U Y K N O W S W H AT H E I S S AY I N G !
/294
![Page 5: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/5.jpg)
/295
https://scontent-cdg2-1.xx.fbcdn.net/hphotos-xpf1/v/t1.0-9/11988277_940537889346397_4268350028529041140_n.jpg?oh=21667a717b8f08e939ce38a7a95e0117&oe=566A7EDA
![Page 6: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/6.jpg)
H AT E
/296
![Page 7: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/7.jpg)
• http://webonastick.com/php.html
• http://phpsadness.com/
• http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
• http://whydoesitsuck.com/why-does-php-suck/
• http://pythonhaspower.com/posts/2014/06/php-i-python-biznesowe-por%C3%B3wnanie-budowy-aplikacji/
And many more…
B A D O P I N I O N
/297
![Page 8: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/8.jpg)
(bool) „true” => true (bool) „1” => true (bool) 1 => true (bool) -1 => true (bool) 0 => false (bool) „” => false
(bool) array() => ? (bool) „false” => ? (bool) „0” => ?
I N C O N S I S T E N C Y - B O O L E A N S
/298
![Page 9: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/9.jpg)
(bool) „true” => true (bool) „1” => true (bool) 1 => true (bool) -1 => true (bool) 0 => false (bool) „” => false
(bool) array() => false (bool) „false” => true (bool) „0” => false
I N C O N S I S T E N C Y - B O O L E A N S
/299
http://php.net/manual/en/language.types.boolean.php
![Page 10: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/10.jpg)
I N C O N S I S T E N C Y - D O C S
/2910
http://php.net/manual/en/class.datetime.php http://php.net/manual/pl/class.datetime.php
![Page 11: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/11.jpg)
strpos(haystack, needle, offset)
array_search(needle, haystack, strict)
urlencode()
utf8_encode()
get_class()
array_merge()
strlen()
str_pad()
I N C O N S I S T E N C Y - N A M I N G
/2911
![Page 12: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/12.jpg)
E A S Y T O U S E : (
Fast to set up
Used even for complicated projects
Flexible
/2912
![Page 13: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/13.jpg)
I T I S N O T 2 0 0 4 A N Y M O R E
/2913
![Page 14: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/14.jpg)
L E T ’ S FA C E T H E T R U T H
facebook.com baidu.com wikipedia.org twitter.com
/2914
http://w3techs.com/technologies/details/pl-php/all/all
http://w3techs.com/technologies/overview/programming_language/all
![Page 15: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/15.jpg)
L O V E
/2915
![Page 16: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/16.jpg)
R U L E S
SOLID
KISS
YAGNIDRY
Object Calisthenics
Clean Code
OOP
/2916
![Page 17: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/17.jpg)
T O O L S
SilexSymfony
Drupal
Laravel
Behat
PHPSpec
Codeception
Typo3
Sylius
PHPUnit
Twig
/2917
Joomla
WordpressZend
![Page 18: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/18.jpg)
L E A R N I N G F R O M O T H E R S
/2918
![Page 19: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/19.jpg)
C O M M U N I T Y
MIT
Open Source
Packagist
Composer
/2919
![Page 20: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/20.jpg)
PA C K A G I S T - S TAT I S T I C S
/2920https://packagist.org/statistics
![Page 21: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/21.jpg)
E A S Y T O U S E !
Fast to set up
Good even for complicated projects
Flexible
/2921
![Page 22: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/22.jpg)
P H P S P E C - M A G I C A L F L E X I B I L I T Y
function it_calculates_tax_as_percentage_of_given_base ( TaxRateInterface $rate ) { $rate->getAmount()->willReturn(0.23);
$this->calculate(10000, $rate)->shouldReturn(2300); }
/2922
![Page 23: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/23.jpg)
F U T U R E
/2923
![Page 24: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/24.jpg)
P H P 7
/2924
![Page 25: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/25.jpg)
W H AT ’ S N E W O R W H AT ’ S B E T T E R
• Performance
• Exceptions on fatals
• Scalar typehints
• Return typehints
• Removal of many deprecated features
/2925
And much more…http://talks.php.net/fluent15#/php7
![Page 26: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/26.jpg)
P E R F O R M A N C E
/2926
http://talks.php.net/fluent15#/wpbench
http://talks.php.net/fluent15#/drupalbench
![Page 27: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/27.jpg)
– A L M U A L I M
„You are not free to do what you want”
/2927
![Page 28: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/28.jpg)
„With great flexibility comes great responsibility”
/2928
![Page 29: Why do I love and hate php?](https://reader033.vdocuments.mx/reader033/viewer/2022042604/58786f161a28ab497b8b5aab/html5/thumbnails/29.jpg)
Q U E S T I O N S ?
/2929
Łukasz Chruściel@lukaszchrusciel
https://github.com/lchrusciel