Skip to content

Loading…

DCOM-212: [GH-296] Proxies shouldn't serialize static properties in __sleep() #518

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of mnapoli:

Url: #296

Message:

This PR contains a test and a fix for the following bug: Proxies did serialize static properties.

I believe this is a regression in 2.4 since I've never met this bug before.

Given the class:

class StaticPropertyClass
{
    protected static $protectedStaticProperty;
}

Before the fix, proxies would contain the following **sleep method:

    public function **sleep()
    {
        if ($this->*_isInitialized_*) {
            return array('*_isInitialized_*', 'protectedStaticProperty');
        }

        return array('*_isInitialized_*', 'protectedStaticProperty');
    }

With the fix:

    public function **sleep()
    {
        if ($this->*_isInitialized_*) {
            return array('*_isInitialized_*');
        }

        return array('*_isInitialized_*');
    }
@doctrinebot

Comment created by @doctrinebot:

A related Github Pull-Request [GH-296] was closed:
#296

@doctrinebot

Comment created by @ocramius:

Merged: 4233262

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.5.0 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.