sandbox.php

Branches > main > d3c0a10 > files / nvim / pack / plugins / opt / conjure / dev / php / sandbox.php

<?php

$fn = fn(int $x) => $x * $x;

$fn(5);

class Adder
{
    public function __construct(
        private int $base
    ) {}

    public function add(int $add): int
    {
        return $this->base + $add;
    }
}

$test = new Adder(100);

$test->add(12);