Skip to content

InvalidPropertyAssignment

A value assigned to a property is incompatible with the property’s declared type.

<?php
class User {
public int $age;
}
$user = new User();
$user->age = 'twenty'; // string, int expected

Assign a value of the correct type or update the property type declaration.