Download src/php/php-src/ext/pdo/tests/bug_60665.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/bug_60665.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo/tests/bug_60665.phpt
-
curl -L -o bug_60665.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/bug_60665.phpt
1.12 kB
| --TEST-- | |
| PDO Common: Bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY returns false) | |
| --EXTENSIONS-- | |
| pdo | |
| --SKIPIF-- | |
| $dir = getenv('REDIR_TEST_DIR'); | |
| if (false == $dir) die('skip no driver'); | |
| require_once $dir . 'pdo_test.inc'; | |
| PDOTest::skip(); | |
| --FILE-- | |
| if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); | |
| require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | |
| $db = PDOTest::factory(); | |
| switch ($db->getAttribute(PDO::ATTR_DRIVER_NAME)) { | |
| case 'oci': $from = ' FROM DUAL'; break; | |
| case 'firebird': $from = ' FROM RDB$DATABASE'; break; | |
| default: $from = ''; break; | |
| } | |
| $statement = $db->prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one $from"); | |
| $statement->execute(); | |
| $row = $statement->fetch(PDO::FETCH_LAZY); | |
| var_dump( | |
| empty($row->null_value), | |
| empty($row->zero), | |
| !empty($row->one), | |
| empty($row->missing), | |
| !isset($row->null_value), | |
| isset($row->zero), | |
| isset($row->one), | |
| !isset($row->missing) | |
| ); | |
| --EXPECT-- | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| bool(true) | |
| bool(true) | |