|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-31 11:52 UTC] iliaa@php.net
-Status: Open
+Status: Bogus
[2011-05-31 11:52 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ Using php 5.3.5 with pdo_pgsql and pgsql 9.0.2 when inserting serialized objects that contain private variables the serialized string is truncate as soon as it hits the private variable. Objects that do not contain private variables work fine. When using the pdo_mysql driver it also works fine. Test script: --------------- <?php class foo{ private $_var; } $foo=serialize(new foo()); $q=new PDO("pgsql:host=localhost;dbname=testdb","root",""); $q->exec('CREATE TABLE test (data TEXT)'); $s=$q->prepare("INSERT INTO test VALUES(?)"); $s->bindValue(1,$foo); $s->execute(); $s=$q->query("SELECT * FROM test"); var_dump($s->fetchAll(PDO::FETCH_ASSOC),$foo); Expected result: ---------------- array(1) { [0]=> array(1) { ["data"]=> string(32) "O:3:"foo":1:{s:9:"foo_var";N;}" } } string(32) "O:3:"foo":1:{s:9:"foo_var";N;}" Actual result: -------------- array(1) { [0]=> array(1) { ["data"]=> string(18) "O:3:"foo":1:{s:9:"" } } string(32) "O:3:"foo":1:{s:9:"foo_var";N;}"