Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in object instantiation #90

Closed
sherryt400 opened this issue Mar 18, 2018 · 2 comments
Closed

Problem in object instantiation #90

sherryt400 opened this issue Mar 18, 2018 · 2 comments

Comments

@sherryt400
Copy link

Hi Mr Ker0x i hope you doing well,
Sir we are using ker0x messenger sdk and our team having object instantiate problem. Let me explain

In figure 1.1
you can see that we are ceating 2 objects
$messenger1 (on line 33)
$messenger2 (on line 34)

with pageToken
abc (on line 33)
xyz (on line 34)

respectively.

Then we simple var_dump the objects on line number 40 and 49 respectively.

In figure 1.2
you can see the results that we are having same pageToken for both objects i.e. pageToken is abc for $messenger1 and $messenger2, for $messenger2 it should be xyz

So we debug the problem and found some piece of code that may be creating the problem i.e. in figure 1.3 you can see code snippet
In this code you are saving instance in static variable $_instance which doesn't get reinitialize while creating new object.

so i hope you can understand the problem and will be fixing it soon.

PS: problem persists in both versions i.e. 1.x and 2.x and we are using version 1.4

best Regards

figure 1 1
figure 1 2
figure 1 3

ker0x added a commit that referenced this issue Mar 18, 2018
[#90] Remove Singleton design pattern on Api class
ker0x added a commit that referenced this issue Mar 18, 2018
[#90] Remove Singleton design pattern on Api class
@ker0x
Copy link
Owner

ker0x commented Mar 18, 2018

Hello @sherryt400 !

Thanks for reporting this issue, I just release a patch fixing the problem for both version, 1.x and 2.x 😉

@sherryt400
Copy link
Author

Thank you really appreciated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants