Hello,
I think that this is probably not a bug, but my misuse, that’s why I decided to post it here instead of creating a new issue.
The error I am getting when compiling Haxe to PHP is “php.NativeString has no field substr”.
Description:
In our project we had to override standard Haxe implementation of JSON parsing (it was related the case described in Compiler flag haxeJSON does not work for Python · Issue #9203 · HaxeFoundation/haxe · GitHub). More specifically, we’ve overridden class JsonParser
and internal function parseNumber
.
In the standard library there is a call to String.substr
method (haxe/JsonParser.hx at development · HaxeFoundation/haxe · GitHub). But the same code fails to compile when I use it in my overridden class.
I’ve tried providing -D haxeJSON
flag to Haxe compiler, but it didn’t help.
BTW, our solution works fine with JS, Java and Python.
Maybe there is some flag that I am missing which allows to disable using of php.NativeString
or maybe there is some better solution?
Thanks!