Edit report at https://bugs.php.net/bug.php?id=62000&edit=1

 ID:                 62000
 User updated by:    sicommnend at gmail dot com
 Reported by:        sicommnend at gmail dot com
 Summary:            sqlite3 db in ob_start callback fails
 Status:             Open
 Type:               Bug
 Package:            SQLite related
-Operating System:   
+Operating System:   Linux
-PHP Version:        5.4.3
+PHP Version:        5.3
 Block user comment: N
 Private report:     N

 New Comment:

Wrong PHP version meant 5.3


Previous Comments:
------------------------------------------------------------------------
[2012-05-10 21:45:08] sicommnend at gmail dot com

The test script I posted above will suceed, this is the one that will fail. Got 
my testing scripts mixed up there.

<?php
ob_start('callbackfunc');
echo 'test test test test test test test test test ';
function callbackfunc($buffer) {
        $DB = new SQLite3('db');
        $DB->exec('CREATE TABLE test (one int, two text);');
        $DB->exec('INSERT INTO test VALUES (10, \'some text\')');
        return $buffer;
}
?>

------------------------------------------------------------------------
[2012-05-10 21:43:12] sicommnend at gmail dot com

Description:
------------
If you connect to a SQLite3 database in the ob_start callback function then the 
script exits without any output and the database doesn't get written to.

In the test script if you move the SQLite3 database code out of the callback 
function the script works, however it fails if there is any connection to a 
SQLite3 database withing the callback function.

Test script:
---------------
<?php
ob_start('callbackfunc');
echo 'test test test test test test test test test ';
function callbackfunc($buffer) {

        return $buffer;
}

        $DB = new SQLite3('db');
        $DB->exec('CREATE TABLE test (one int, two text);');
        $DB->exec('INSERT INTO test VALUES (10, \'some text\')');
?>

Expected result:
----------------
The database gets written to and the output gets sent.

Actual result:
--------------
Script exits with no output and database is not created.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62000&edit=1

Reply via email to