b0y-101 Mini Shell


Current Path : E:/www/b-group.old/spfin - Copy/mainpay/src/xdebug/tests/base/
File Upload :
Current File : E:/www/b-group.old/spfin - Copy/mainpay/src/xdebug/tests/base/bug01907.phpt

--TEST--
Test for bug #1907: Empty exception message when setting the $message property to a stringable object
--FILE--
<?php
  
class LazyException extends Exception
{
    public function __construct()
    {
        parent::__construct();

        $this->message = new class() {
            public function __toString()
            {
                return 'World';
            }
        };
    }
}

$e = new LazyException();

try {
    throw $e;
} catch (\Exception $e) {
    echo 'Hello ';
    echo $e->getMessage();
    echo "\n";
}
?>
--EXPECT--
Hello World

Copyright © 2019 by b0y-101