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

Live preview is wrong #20

Closed
Bilge opened this issue Aug 1, 2024 · 4 comments
Closed

Live preview is wrong #20

Bilge opened this issue Aug 1, 2024 · 4 comments

Comments

@Bilge
Copy link

Bilge commented Aug 1, 2024

How does live preview (not) work? The problems I'm seeing are that the results from live preview are bogus and you only get the real result after clicking the eval() button. This is highly misleading and problematic.

Examples

echo PHP_INT_MAX * 10;
Live-preview eval();
21474836470 9.2233720368548E+19
echo (int)(PHP_INT_MAX * 10);
Live-preview eval();
-10 0
@SjonHortensius
Copy link
Owner

As you no doubt concluded yourself, the live preview is 32 bits, the non-live are 64 bits - so this is basically a duplicate of #19 :)

@Bilge
Copy link
Author

Bilge commented Aug 1, 2024

Actually, I had not concluded that, so thanks for the clarification!

But my question about live preview still stands: how does it work? I suppose I could try digging into the source, but I hoped it would be easier to just ask. The response seems near-realtime and I was just naturally curious how that is even possible?

@Bilge
Copy link
Author

Bilge commented Aug 1, 2024

I guess it's just using this: https://github.com/seanmorris/php-wasm.

@SjonHortensius
Copy link
Owner

I guess it's just using this: https://github.com/seanmorris/php-wasm.

correct although until recently I used something I build myself

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