How PHP allows to set values without setter methods or constructor

Code
<?php

class Foo
{
    private 
$foo;
    private 
$bar;

    private function 
__construct()
    {
    }
    
    public static function 
createDefault()
    {
        
$foo = new self();
        
$foo->foo 1;
        
$foo->bar 2;
        
        return 
$foo;
    }
}

dump(Foo::createDefault());
Result
^ Foo {#1390
-foo: 1
-bar: 2
}
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8