Q: Haxe/php Array.length I have a problem with the translation of a for-loop from Haxe to php. The loop traces the content of my array "steps". In Haxe it is working fine.
Haxe Code: 
private var _steps:Array<Step> = new Array<Step>();

public function initFrontendData(steps:Array<Step>) {
    _steps = steps;     

    for (i in 0..._steps.length) {
        var step:Step = _steps[i];
        trace("Step: "+ step.id + ", Name: " + step.name + "<br />");
    }
}

But if I use the translates php code I get the error:
uncaught exception: Trying to get property of non-object (errno: 8) in path\konf\Konfigurator.class.php at line #28Trying to get property of non-object.
Line 28 is $_g = $this->_steps->length;
Generated php code:
public $_steps;
public function initFrontendData($steps) {
    $this->_steps = $steps;
    {
        $_g1 = 0;
        $_g = $this->_steps->length;
        while($_g1 < $_g) {
            $i = $_g1++;
            $step = $this->_steps[$i];
            haxe_Log::trace("Schritt " . _hx_string_rec($step->id, "") . ", " . _hx_string_or_null($step->name) . "<br />", _hx_anonymous(array("fileName" => "Konfigurator.hx", "lineNumber" => 76, "className" => "konf.Konfigurator", "methodName" => "initFrontendData")));
            unset($step,$i);
        }
    }       
}

If I manually change the line 28 from:
$_g = $this->_steps->length;

to
$_g = count($this->_steps);

everything works fine. But I don't want to change the generated php code manually and I think its not the intention of Haxe to change generated code manually.
Do I have an error in my Haxe code or has the php translator of Haxe a Bug? How can I solve the problem without changing the generated php code?
thx Pockie

A: Franco Ponticelli answered the question in the comments section of my question.
Quote:
Are you sure your source array is an Haxe generated array and not a native PHP array? If it is a native one, it needs to be wrapped using php.Lib.toHaxeArray(native) see api.haxe.org/php/Lib.html#toHaxeArray –  Franco Ponticelli 2 days ago 
