ker0x/messenger

Problem in object instantiation

sherryt400 opened this issue · 2 comments

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 commented

Hello @sherryt400 !

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

Thank you really appreciated :)