Skip to content

Returning value by reference not working  #12

Open
@zeugentor

Description

@zeugentor

I cannot get value by reference in php-5.6. The same issue is in php-cpp-2.0.0 release for php-7.0.

C++ code:
Php::Value Setting::lookupValueFloat(Php::Parameters& params) const {
double value = 0;
bool res = _setting.lookupValue((const char*)params[0], value); -- c++ internal object
params[1] = value;
return res;
}

Php code:
$val = false;
$flag = $cfg->lookupValueFloat("humidy", $val);
echo("flag = ".$flag." humidy val = ".$val."\n");

$ php --version
PHP 5.6.31-1~ubuntu16.04.1+deb.sury.org+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

$ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 18.2 Sonya
Release: 18.2
Codename: sonya

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions