Why I don’t need to define some property in PHP class

  oop, php

why in this class I don’t need defined property userModel and postModel?

   class Users extends Controller
    {
        public function __construct()
        {
          $this->userModel = 1;
          $this->postModel = 2;
        }
     
    }

$obj = new Users;
var_dump($obj->userModel); // OK

Source: Ask PHP

LEAVE A COMMENT