COMMUNITY

How to handle mixed result from php

haxe-php

(Дмитрий Маликов) #1

in example some php function return boolean false or integer
how to handle it in haxe?


(Aleksandr Kuzmenko) #2

Here is how it’s handled in std: https://github.com/HaxeFoundation/haxe/blob/002502d4a67208dc4226b9479e1b1d3e1cbe9ffa/std/php/Global.hx#L401

static function substr( string:String, start:Int, ?length:Int ) : EitherType<Bool,String>;