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
– 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
Silex
Twig
PHP-CS-FIXER
Pimple
/293
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
/295
https://scontent-cdg2-1.xx.fbcdn.net/hphotos-xpf1/v/t1.0-9/11988277_940537889346397_4268350028529041140_n.jpg?oh=21667a717b8f08e939ce38a7a95e0117&oe=566A7EDA
H AT E
/296
• 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
(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
(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
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
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
E A S Y T O U S E : (
Fast to set up
Used even for complicated projects
Flexible
/2912
I T I S N O T 2 0 0 4 A N Y M O R E
/2913
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
L O V E
/2915
R U L E S
SOLID
KISS
YAGNI
DRY
Object Calisthenics
Clean Code
OOP
/2916
T O O L S
Silex
Symfony
Drupal
Laravel
Behat
PHPSpec
Codeception
Typo3
Sylius
PHPUnit
Twig
/2917
Joomla
WordpressZend
L E A R N I N G F R O M O T H E R S
/2918
C O M M U N I T Y
MIT
Open Source
Packagist
Composer
/2919
PA C K A G I S T - S TAT I S T I C S
/2920
https://packagist.org/statistics
E A S Y T O U S E !
Fast to set up
Good even for complicated projects
Flexible
/2921
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
F U T U R E
/2923
P H P 7
/2924
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
P E R F O R M A N C E
/2926
http://talks.php.net/fluent15#/wpbench
http://talks.php.net/fluent15#/drupalbench
– A L M U A L I M
„You are not free to do what you want”
/2927
„With great flexibility comes great responsibility”
/2928
Q U E S T I O N S ?
/2929
Łukasz Chruściel
@lukaszchrusciel
https://github.com/lchrusciel

Why do I love and hate php?

  • 1.
    W H YD 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
  • 2.
    – FA BI E N P O T E N C I E R „People hate PHP as a Language People like PHP as a Platform” /292
  • 3.
  • 4.
    T H IS G U Y K N O W S W H AT H E I S S AY I N G ! /294
  • 5.
  • 6.
  • 7.
    • 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
  • 8.
    (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
  • 9.
    (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
  • 10.
    I N CO 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
  • 11.
    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
  • 12.
    E A SY T O U S E : ( Fast to set up Used even for complicated projects Flexible /2912
  • 13.
    I T IS N O T 2 0 0 4 A N Y M O R E /2913
  • 14.
    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
  • 15.
    L O VE /2915
  • 16.
    R U LE S SOLID KISS YAGNI DRY Object Calisthenics Clean Code OOP /2916
  • 17.
    T O OL S Silex Symfony Drupal Laravel Behat PHPSpec Codeception Typo3 Sylius PHPUnit Twig /2917 Joomla WordpressZend
  • 18.
    L E AR N I N G F R O M O T H E R S /2918
  • 19.
    C O MM U N I T Y MIT Open Source Packagist Composer /2919
  • 20.
    PA C KA G I S T - S TAT I S T I C S /2920 https://packagist.org/statistics
  • 21.
    E A SY T O U S E ! Fast to set up Good even for complicated projects Flexible /2921
  • 22.
    P H PS 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
  • 23.
    F U TU R E /2923
  • 24.
    P H P7 /2924
  • 25.
    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
  • 26.
    P E RF O R M A N C E /2926 http://talks.php.net/fluent15#/wpbench http://talks.php.net/fluent15#/drupalbench
  • 27.
    – A LM U A L I M „You are not free to do what you want” /2927
  • 28.
    „With great flexibilitycomes great responsibility” /2928
  • 29.
    Q U ES T I O N S ? /2929 Łukasz Chruściel @lukaszchrusciel https://github.com/lchrusciel