Question: Ive looked and tried but I can't find an answer. 

In PHP, is it possible to call a class' member function (when that class requires a constructor to receive parameters) without instantiating it as an object?

A code example (which gives errors):

```
<?php

class Test {
    private $end="";

    function __construct($value) {
        $this->end=$value;
    }

    public function alert($value) {
        echo $value." ".$this->end;
    }
}

//this works:
$example=new Test("world");
$example->alert("hello");

//this does not work:
echo Test("world")::alert("hello");

?>

```

Answer: 
For this you can do a

<https://www.php.net/manual/en/reflectionclass.newinstancewithoutconstructor.php>

reflect your class and trigger the new instance without constructor.

Here a sample code:

```
<?php

class Test {
    private $end="";

    function __construct($value) {
        $this->end=$value;
    }

    public function alert($value) {
        echo $value." ".$this->end;
    }

    public function end($value) {

        $this->end = $value;        

        return $this; // return Test object so that you can chain to other function method.
    }
}

// Solution #1:
// reflect your class.
$reflector = new \ReflectionClass('Test');

// Then create a new instance without Constructor.
// This will ignore the constructor BUT it will create a new instance of class Test.
$say = $reflector->newInstanceWithoutConstructor();

// use end method that will return the Test object, then you can chain the alert()
$say->end('World!')->alert("Hello"); // output: Hello World!

?>

```
```
// this does not work:
echo Test("world")::alert("hello");

// works, as you are calling not to an object of the class, but to its namespace
echo Test::alert("hello");

```