Location: PHPKode > scripts > Craur > Craur-1.7.4/tests/get_attribute_for_first_element_of_array_test.php
<?php
/*
 * @see <https://github.com/DracoBlue/Craur/issues/3>
 */

$node = Craur::createFromJson(json_encode(array(
    'book' => array(
        'author' => array(
            array(
                '@name' => 'Hans'
            ),
            array(
                '@name' => 'Paul'
            ),
        )
    )
)));

/*
 * Should be the first name
 */
assert('Hans' == $node->get('hide@address.com'));
Return current item: Craur