In Javascript, I can refer to and use a constructor function dynamically:
function Circle() {
}
function Squere() {
}
var constructor = null;
constructor = Circle;
var shape1 = new constructor();
console.log(shape1 instanceof Circle); // output: true
constructor = Squere;
var shape2 = new constructor();
console.log(shape2 instanceof Squere); // output: true
Is it possible and how can I do the same in php ? How can I take a class declaration in php and refer to and use it dynamically so the calling code does not know/care what it is creating ?