If you found this error “Cannot access empty property” when dealing with OOP in PHP the cause of the error most probably because you are using “$” in front of class method.
For example:
$user->$delete($id) // incorrect
$user->delete($id) // correct