trigger_error

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Generates a user-level error/warning/notice message
Alias user_error
<?php trigger_error(string $message, int $error_level = E_USER_NOTICE): true
<?php             foreach ($this as $key) {

                if (! $values->valid()) {

                    trigger_error($errorMessage, E_USER_WARNING);



                    break;

                }
<?php             }



            if ($values->valid()) {

                trigger_error($errorMessage, E_USER_WARNING);

            }

        });

    }
<?php     {

        $this->withDeprecationHandling();



        trigger_error('Something is deprecated', E_USER_DEPRECATED);



        $this->assertTrue($this->deprecationsFound);

    }
<?php         $this->expectException(ErrorException::class);

        $this->expectExceptionMessage('Something is deprecated');



        trigger_error('Something is deprecated', E_USER_DEPRECATED);

    }



    protected function tearDown(): void
<?php             $className = substr($className, 2);

        }



        trigger_error(sprintf('Undefined property %s::$%s', $className, $property), E_USER_WARNING);



        return null;

    }
<?php <?php



test('notice', function () {

    trigger_error('This is a notice description', E_USER_NOTICE);



    expect(true)->toBeTrue();

});
<?php describe('a "describe" group of tests', function () {

    test('notice', function () {

        trigger_error('This is a notice description', E_USER_NOTICE);



        expect(true)->toBeTrue();

    });
<?php });



test('user warning', function () {

    trigger_error('This is a warning description', E_USER_WARNING);



    expect(true)->toBeTrue();

});
<?php describe('a "describe" group of tests', function () {

    test('user warning', function () {

        trigger_error('This is a warning description', E_USER_WARNING);



        expect(true)->toBeTrue();

    });
<?php                     $max = empty($matches[2]) ? '99.9' : $matches[2];



                    if (\version_compare($min, $max, '>')) {

                        \trigger_error(

                            "Invalid range in testVersion setting: '" . $testVersion . "'",

                            \E_USER_WARNING

                        );

                        return $default;

                    } else {

                        $arrTestVersions[$testVersion] = [$min, $max];
<?php                 }

            }



            \trigger_error(

                "Invalid testVersion setting: '" . $testVersion . "'",

                \E_USER_WARNING

            );

            return $default;

        }
<?php     public function setIgnorePlatformRequirements($ignorePlatformReqs)

    {

        trigger_error('AutoloadGenerator::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead.', E_USER_DEPRECATED);



        $this->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs));

    }
<?php                 }



                if ($value === 'symlink') {

                    trigger_error('config.bin-compat "symlink" is deprecated since Composer 2.2, use auto, full (for Windows compatibility) or proxy instead.', E_USER_DEPRECATED);

                }



                return $value;
<?php     public static function getRawData()

    {

        @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);



        if (null === self::$installed) {
<?php     public function setIgnorePlatformRequirements($ignorePlatformReqs)

    {

        trigger_error('Installer::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead.', E_USER_DEPRECATED);



        return $this->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList($ignorePlatformReqs));

    }