Download src/php/php-src/Zend/tests/exceptions/bug47771.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 476 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug47771.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/exceptions/bug47771.phpt
-
curl -L -o bug47771.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/exceptions/bug47771.phpt
476 Bytes
| --TEST-- | |
| Bug #47771 (Exception during object construction from arg call calls object's destructor) | |
| --FILE-- | |
| function throw_exc() { | |
| throw new Exception('TEST_EXCEPTION'); | |
| } | |
| class Test { | |
| public function __construct() { | |
| echo 'Constr' ."\n"; | |
| } | |
| public function __destruct() { | |
| echo 'Destr' ."\n"; | |
| } | |
| } | |
| try { | |
| $T =new Test(throw_exc()); | |
| } catch( Exception $e) { | |
| echo 'Exception: ' . $e->getMessage() . "\n"; | |
| } | |
| --EXPECT-- | |
| Exception: TEST_EXCEPTION | |