Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #79294 ()::columnType() may fail after SQLite3Stmt::reset()) --EXTENSIONS-- s..

Decoded Output download

--TEST--
Bug #79294 ()::columnType() may fail after SQLite3Stmt::reset())
--EXTENSIONS--
sqlite3
--FILE--
<?php
$db = new SQLite3(':memory:');
$db->exec("CREATE TABLE foo (bar INT)");
$db->exec("INSERT INTO foo VALUES (1)");

$stmt = $db->prepare("SELECT * FROM foo");
$res = $stmt->execute();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
$stmt->reset();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
$res->reset();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
?>
--EXPECT--
bool(true)
int(1)
bool(false)
bool(false)
bool(true)
int(1)
bool(true)
int(1)

Did this file decode correctly?

Original Code

--TEST--
Bug #79294 ()::columnType() may fail after SQLite3Stmt::reset())
--EXTENSIONS--
sqlite3
--FILE--
<?php
$db = new SQLite3(':memory:');
$db->exec("CREATE TABLE foo (bar INT)");
$db->exec("INSERT INTO foo VALUES (1)");

$stmt = $db->prepare("SELECT * FROM foo");
$res = $stmt->execute();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
$stmt->reset();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
$res->reset();
var_dump($res->fetchArray() !== false);
var_dump($res->columnType(0));
?>
--EXPECT--
bool(true)
int(1)
bool(false)
bool(false)
bool(true)
int(1)
bool(true)
int(1)

Function Calls

None

Variables

None

Stats

MD5 d47efb8c0af3b3f5ff90533bdaec664e
Eval Count 0
Decode Time 82 ms