# PHP Programming Language

- Page: https://shared.btbytes.com/p/php
- Date: 2020-04-07
- Tags: programming-language

[25 years of PHP history](https://www.jetbrains.com/lp/php-25/) a chronological story of PHP by JetBrains.

* [New in PHP 8 - stitcher.io](https://stitcher.io/blog/new-in-php-8)
- [PHP in 2019 - stitcher.io](https://stitcher.io/blog/php-in-2019)
- [PHP The Right Way](http://www.phptherightway.com/); apparently the best way to do PHP dev in 2019. :thumbsup: Also [PHP - The Wrong Way](http://www.phpthewrongway.com/)
- [The 2018 Guide to Building Secure PHP Software - Paragon Initiative Enterprises Blog](https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software) [Dec 2017]

Jan 2019 Notes:

* [My Modern PHP Development Setup · John Mackenzie](https://johnmackenzie.co.uk/post/my-modern-php-development-setup/); Jan 2019
    * Use PHPStorm
    * Use `.editorconfig`
    * Use Docker
    * Use [PHP-CS-Fixer](https://github.com/FriendsOfPhp/PHP-CS-Fixer)
* VSCode is also nice
* Built in server -- `php -S localhost:8000`
* Frameworks
    1. [Laravel - The PHP Framework For Web Artisans](https://laravel.com/) and [Spatie libs](https://spatie.be/open-source)
    2. [Lumen - PHP Micro-Framework By Laravel](https://lumen.laravel.com/)

## Success stories

[Facebook’s backups were written in PHP. Well, the second version was, anyway. (T... | Hacker News](https://news.ycombinator.com/item?id=25221984)

> Multiprocess, forking, long-lived, server-side, I/O intensive PHP. And it worked brilliantly. Over the following years, it scaled from a backup set of a few hundred TB to many, many petabytes.


## Alternatives

[alekcz/pcp: PCP: Clojure Processor -- Like drugs but better](https://github.com/alekcz/pcp)

Just use it like PHP on a webserver (say [nginx](https://shared.btbytes.com/p/nginx)):

        #new pcp config => change .php to .clj
        index index.clj index.html index.htm;
        #new pcp config => change .php to .clj
        location ~ \.clj$ {
            #default nginx config on digital ocean lemp image
            #include snippets/fastcgi-php.conf;
            #fastcgi_pass unix:/run/php/php7.0-fpm.sock;

            include scgi_params;
            scgi_intercept_errors on;
            scgi_pass   127.0.0.1:9000;
        }

PCP has following libraries built in:

    (require  '[cheshire.core :as json]
          '[clostache.parser :as clo]
          '[selmer.parser :as parser]
          '[selmer.filters :as filters]
          '[clj-http.lite.client :as client]
          '[next.jdbc :as jdbc]
          '[honeysql.core :as sql]
          '[honeysql.helpers :as helpers]
          '[postal.core :as email]
          '[clojurewerkz.scrypt.core :as sc])

---

[FrankenPHP: the modern PHP app server](https://frankenphp.dev/) "Uses the official PHP executor embedded in a state-of-the-art web server: **[Caddy](https://caddyserver.com/)**"; written in [golang](https://shared.btbytes.com/p/golang)
