I am studying about the binding process and the classification of variable based on storage binding. So, I faced with four kind of variable:
My question is about the type 2 and 4. In programming languages whose the type biding is dynamic(Php, Ruby, Python, ...) all variable appears to be of type 4.
Is it true? All variables even the local variables are put on heap? Is this a implementation thing or there is not a possibility to implement a language with dynamic type binding whose local variables are put in stack and the others in heap?
No. There is no correlation between typing and allocation. The first is a language feature, the second (usually) a detail of a specific implementation that may depend on specific optimisations and other factors. Some variables will not be "allocated" at all. In more high-level languages, it is even wrong to assume that there is any connection between variables and allocation at all -- they just name certain values in the program text.
The only relation types have with all of this is that they enable more interesting optimisations, or at least make them much easier.