Download src/php/php-src/Zend/tests/assert/expect_011.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 688 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/assert/expect_011.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/assert/expect_011.phpt
-
curl -L -o expect_011.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/assert/expect_011.phpt
688 Bytes
| --TEST-- | |
| test overloaded __toString on custom exception | |
| --INI-- | |
| zend.assertions=1 | |
| assert.exception=1 | |
| --FILE-- | |
| class MyExpectations extends AssertionError { | |
| public function __toString() { | |
| return sprintf( | |
| "[Message]: %s", __CLASS__); | |
| } | |
| } | |
| class One { | |
| public function __construct() { | |
| assert(false, (string) new MyExpectations()); | |
| } | |
| } | |
| class Two extends One {} | |
| new Two(); | |
| --EXPECTF-- | |
| Fatal error: Uncaught AssertionError: [Message]: MyExpectations in %sexpect_011.php:%d | |
| Stack trace: | |
| #0 %sexpect_011.php(%d): assert(false, '[Message]: MyEx...') | |
| #1 %sexpect_011.php(%d): One->__construct() | |
| #2 {main} | |
| thrown in %sexpect_011.php on line %d | |