Attempted to serialize unserializable builtin class PDO #8

Open
elazar opened this Issue Oct 13, 2015 · 1 comment

Projects

None yet

2 participants

@elazar
elazar commented Oct 13, 2015

This error occurs when a global variable is present that has an array containing a PDO instance assigned to it.

The issue appears to stem from lack of support for this particular scenario in Snapshot->canBeSerialized().

I encountered this behavior while running PHPUnit tests in an environment where PHP configured to use xhprof, which unfortunately uses a global for its configuration and contains a PDO instance in said configuration.

It's possible this issue may be resolved with #3. Until it is, it appears there's no way to run PHPUnit with @backupGlobals and xhprof enabled without modifying xhprof core files.

@malkusch
malkusch commented Nov 3, 2015

Thank you for creating this issue. #3 looks indeed like a rescue. I just wanted to bring up the same issue in the context of @backupStaticAttributes. Snapshot::canBeSerialized() does look only at the directly passed attribute (from snapshotStaticAttributes()). Unfortunately if any deeper property of that passed object does have an unserializable object it bails out.

@malkusch malkusch referenced this issue in php-mock/php-mock-phpunit Nov 3, 2015
Closed

Build failing under HHVM #3

@malkusch malkusch added a commit to php-mock/php-mock-phpunit that referenced this issue Nov 3, 2015
@malkusch malkusch Don't use mockery because of sebastianbergmann/global-state#8 07d27df
@malkusch malkusch added a commit to php-mock/php-mock-phpunit that referenced this issue Nov 3, 2015
@malkusch malkusch [#3] Don't use mockery because of sebastianbergmann/global-state#8 15fe891
@malkusch malkusch added a commit to php-mock/php-mock-phpunit that referenced this issue Nov 3, 2015
@malkusch malkusch [#3] Don't use mockery because of sebastianbergmann/global-state#8 ff6d7fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment