oraoto / pib

PHP in Browser (powered by WebAssembly)
https://oraoto.github.io/pib/
Apache License 2.0
956 stars 112 forks source link

Fatal error: strict_types declaration must be the very first statement in the script in php-wasm run script on line 2 #68

Closed SjonHortensius closed 3 months ago

SjonHortensius commented 3 months ago

It seems the php.run() call passes through a slightly different argument then given - which I suspect is caused by this line:

https://github.com/oraoto/pib/blame/d3f8d93e8a1691dbf96d9e5825cee959a68fb136/source/PhpBase.js#L69

this can be reproduced by calling php.run('<?php declare(strict_types=1);')

This was originally reported as https://github.com/SjonHortensius/3v4l_org/issues/21