JsonSerialize Interface of PHP

Code
<?php

class Foo implements JsonSerializable
{
    private $fooName;
    private $fooStatus;
    
    public function __construct($fooName, $fooStatus)
    {
        $this->fooName = $fooName;
        $this->fooStatus = $fooStatus;
    }
    
    public function jsonSerialize()
    {
        return array(
            'name' => $this->fooName, 
            'status' => $this->fooStatus,
        );
    }
}

$foo = new Foo('FooAsVarName', 'OK');
echo json_encode($foo);
Result
{"name":"FooAsVarName","status":"OK"}
Used Versions
PHP 8.3, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8