xref: /PHP-8.2/ext/pdo/tests/bug_40285.phpt (revision 74859783)
1--TEST--
2PDO Common: Bug #40285 (The prepare parser goes into an infinite loop on ': or ":)
3--EXTENSIONS--
4pdo
5--SKIPIF--
6<?php
7$dir = getenv('REDIR_TEST_DIR');
8if (false == $dir) die('skip no driver');
9require_once $dir . 'pdo_test.inc';
10PDOTest::skip();
11?>
12--FILE--
13<?php
14
15if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/');
16require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
17$db = PDOTest::factory();
18
19$db->exec('CREATE TABLE test (field1 VARCHAR(32), field2 VARCHAR(32), field3 VARCHAR(32), field4 INT)');
20
21$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
22$s = $db->prepare("INSERT INTO test VALUES( ':id', 'name', 'section', 22)" );
23$s->execute();
24
25echo "Done\n";
26?>
27--EXPECT--
28Done
29