Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Things you should know about PHP

Things you should know about PHP

An introduction to PHP, presented to the Swansea Software Development Community (SSDC).

71c9ebde850996d2533c5df4df2c93c6?s=128

Oliver Davies

January 28, 2019
Tweet

Transcript

  1. THINGS YOU SHOULD THINGS YOU SHOULD KNOW ABOUT PHP KNOW

    ABOUT PHP By Oliver Davies
  2. Full Stack Web Developer & System Administrator Senior Developer at

    Microserve Part-time freelancer Acquia certified Drupal 8 Grand Master Drupal 7 & 8 core contributor Symfony, Laravel, Sculpin @opdavies oliverdavies.uk
  3. None
  4. ELEPHPANTS ELEPHPANTS!!

  5. WHAT IS PHP? WHAT IS PHP?

  6. PHP is a popular general-purpose scripting language that is especially

    suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world. http://php.net
  7. PERSONAL HOME PAGE PERSONAL HOME PAGE

  8. PHP: HYPERTEXT PREPROCESSOR PHP: HYPERTEXT PREPROCESSOR (recursive acronym)

  9. None
  10. None
  11. None
  12. HOW DO I HOW DO I GET STARTED? GET STARTED?

  13. php -v

  14. php -v PHP 7.1.15 (cli) (built: Mar 14 2018 15:27:17)

    ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
  15. vim index.php

  16. <?php

  17. <?php echo 'Hello World!';

  18. php -S localhost:8000

  19. php -S localhost:8000 PHP 7.3.0 Development Server started Listening on

    http://localhost:8000 Document root is /Users/opdavies Press Ctrl-C to quit.
  20. None
  21. <?php // index.php function say() { echo 'Hello!'; }

  22. <?php // index.php function say($value) { echo $value; }

  23. <?php // index.php function say(string $value): void { echo $value;

    }
  24. <?php // src/Person.php class Person { function say(string $value): void

    { echo $value; } }
  25. <?php // Version 1 say();

  26. <?php // Version 1 say(); // Version 2 say('something');

  27. <?php // Version 1 say(); // Version 2 say('something'); //

    Version 3 $person = new Person(); $person->say('something');
  28. LEVELLING UP LEVELLING UP Content Management Systems

  29. * THESE LISTS ARE * THESE LISTS ARE NOT EXHAUSTIVE

    NOT EXHAUSTIVE
  30. None
  31. None
  32. None
  33. None
  34. None
  35. LEVELLING UP LEVELLING UP Frameworks

  36. None
  37. None
  38. None
  39. BUT I ONLY NEED A BUT I ONLY NEED A

    STATIC SITE STATIC SITE Static site generators
  40. None
  41. None
  42. None
  43. CODE REUSE & CODE REUSE & COLLABORATION COLLABORATION

  44. None
  45. None
  46. None
  47. None
  48. None
  49. composer require symfony/console

  50. { "require": { "symfony/console": "^4.2" } }

  51. <?php require 'vendor/autoload.php';

  52. <?php require 'vendor/autoload.php'; $app = new Application(); $app->run();

  53. None
  54. TOOLS TOOLS

  55. None
  56. None
  57. None
  58. None
  59. <?php final class EmailTest extends TestCase { public function testCanBeCreatedFromValidEmailAddress():

    void { $this->assertInstanceOf( Email::class, Email::fromString('user@example.com') ); } }
  60. None
  61. Feature: Product basket In order to buy products As a

    customer I need to be able to put interesting products into a basket
  62. THE COMMUNITY THE COMMUNITY

  63. None
  64. None
  65. None
  66. None
  67. None
  68. LEARNING LEARNING

  69. None
  70. None
  71. None
  72. None
  73. None
  74. None
  75. THINGS YOU SHOULD KNOW ABOUT PHP THINGS YOU SHOULD KNOW

    ABOUT PHP Very easy to get started A large choice of tools and frameworks A great worldwide community Great learning resources Gain experience by contributing to open source projects
  76. QUESTIONS? QUESTIONS?

  77. THANKS! THANKS! @opdavies oliverdavies.uk