Download src/php/php-src/ext/pdo_mysql/tests/bug53782.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_mysql/tests/bug53782.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_mysql/tests/bug53782.phpt
-
curl -L -o bug53782.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_mysql/tests/bug53782.phpt
619 Bytes
| --TEST-- | |
| PDO MySQL Bug #53782 (foreach throws irrelevant exception) | |
| --EXTENSIONS-- | |
| pdo_mysql | |
| --SKIPIF-- | |
| require_once __DIR__ . '/inc/mysql_pdo_test.inc'; | |
| MySQLPDOTest::skip(); | |
| --FILE-- | |
| require_once __DIR__ . '/inc/mysql_pdo_test.inc'; | |
| $conn = MySQLPDOTest::factory(); | |
| $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $res = $conn->query('SELECT 0'); | |
| try { | |
| $conn->query('ERROR'); | |
| } catch (PDOException $e) { | |
| echo "Caught: ".$e->getMessage()."\n"; | |
| } | |
| foreach ($res as $k => $v) { | |
| echo "Value: $v[0]\n"; | |
| } | |
| echo "DONE"; | |
| --EXPECTF-- | |
| Caught: SQLSTATE[42000]: %s | |
| Value: 0 | |
| DONE | |