method_exists

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class method exists
<?php method_exists(object|string $object_or_class, string $method): bool
<?php     public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)

    {

        if (method_exists($this, 'expectException')) {


            $this->expectException($exception);

            if ($exceptionMessage !== '') {
<?php     public function assertContainsString($needle, $haystack)

    {

        if (method_exists($this, 'assertStringContainsString')) {


            $this->assertStringContainsString($needle, $haystack);

        } else {
<?php     public function assertMatchesRegExp($pattern, $string)

    {

        if (method_exists($this, 'assertMatchesRegularExpression')) {


            $this->assertMatchesRegularExpression($pattern, $string);

        } else {
<?php     public function assertDoesNotMatchRegExp($pattern, $string)

    {

        if (method_exists($this, 'assertDoesNotMatchRegularExpression')) {


            $this->assertDoesNotMatchRegularExpression($pattern, $string);

        } else {