Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: error while generating $arr[] = Elem; #8

Open
i582 opened this issue Aug 17, 2020 · 0 comments
Open

bug: error while generating $arr[] = Elem; #8

i582 opened this issue Aug 17, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@i582
Copy link
Owner

i582 commented Aug 17, 2020

<?php

function F() {
    $arr = 5;
    $arr = ["5"];

    $arr[] = "22";
    echo $arr;
}

Actual Code

func F() {
	arr := NewVar()
	arr.Setint64(5)
	arr.SetElementTypestring([]string{"5"})
	arr.GetElementTypestring() = append(arr.GetElementTypestring(), "22")
	fmt.Print(arr.GetElementTypestring())
}

Expected Code

func F() {
	arr := NewVar()
	arr.Setint64(5)
	arr.SetElementTypestring([]string{"5"})
	arr.SetElementTypestring(append(arr.GetElementTypestring(), "22"))
	fmt.Print(arr.GetElementTypestring())
}
@i582 i582 added the bug Something isn't working label Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant