Remix.run Logo
▲ pampa 4 hours ago

Nothing is elegant about modern php. Maybe the lambdas with 'use' keywords.

You have request()->params, response() in the framework But all the raw data is still there in $_GET & $_POST, file_get_contents('php://input'). You can still echo "" to the browser, and still send header() from everywhere.

It almost looks like php developers around 2009 were really wanting to write enterprise Java, but had to use php at their day jobs, so they gradually made php pretend to be something else.

▲9dev a minute ago | parent | next [-]

yet at the same time, you can do stuff like this in PHP:

  $result = '  PHP 8.6  '
    |> trim(...)
    |> strtolower(...)
    |> str_replace(' ', '-', ?)
    |> (fn(string $s): string => match ($s) {
        'php-8.6' => 'New hotness!',
        default   => 'Something else',
    });
People always seem to get hung up on the standard library and the runtime, but the language itself is amazing by now.
▲dofm 4 hours ago | parent | prev [-]

> Nothing is elegant about modern php. Maybe the lambdas with 'use' keywords.

I was not talking about PHP, but Laravel.