Skip to content

Wrong place... #498

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

Closed
hcngac opened this issue Jul 14, 2016 · 1 comment
Closed

Wrong place... #498

hcngac opened this issue Jul 14, 2016 · 1 comment

Comments

@hcngac
Copy link

hcngac commented Jul 14, 2016

array_push is showing error. Details are following:

PHP version 5.5.37

test.php

<?php
TESTCPP();
?>

TESTCPP()

void TESTCPP() {
    Php::Value a;
    a["b"]["c"] = "a[\"b\"][\"c\"]";
    Php::out << a["b"]["c"] << std::endl;
    Php::out << std::endl;
    a["d"] = Php::Array();
    Php::array_push(a["d"], "0");
    Php::array_push(a["d"], "1");
    Php::out << a["d"][0] << std::endl;
    Php::out << a["d"][1] << std::endl;
    Php::out << std::endl;
}

Output:

a["b"]["c"]

PHP Warning:  Parameter 1 to array_push() expected to be a reference, value given in /home/benng/test.php on line 2
PHP Stack trace:
PHP   1. {main}() /home/benng/test.php:0
PHP   2. testcpp() /home/benng/test.php:2
PHP Fatal error:  Uncaught exception 'Exception' with message 'Invalid call to array_push' in /home/benng/test.php:2
Stack trace:
#0 /home/benng/test.php(2): testcpp()
#1 {main}
  thrown in /home/benng/test.php on line 2

Thank you for your hard-working in this project and please be noticed about this issue.

@hcngac
Copy link
Author

hcngac commented Jul 14, 2016

Sorry wrong place........

@hcngac hcngac closed this as completed Jul 14, 2016
@hcngac hcngac changed the title array_push not working Wrong place... Jul 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants