when I want to statically access the class JSON using an variable it is possible.
Code:
<?php
$classname = "JSON";
$classname::echo_output();
?>
But when I want to use an object variable to statically access the class it fails. code:
<?php
class someclass{
public $classname = "JSON";
public function __construct(){
$this->classname::echo_output();
}
}
?>
Try it yourself.
How I solved it was $classname = $this->classname; But is there any other possible way to solve this?
JSONclass and have already solved the problem you were experiencing. Is there another issue you're having?