Esempio n. 1
0
<?php

// Copyright 2004-2014 Facebook. All Rights Reserved.
function properties()
{
    $c = new stdclass();
    $a = 5;
    $c->foo =& $a;
    var_dump($c);
    $x = $c->foo += 10;
    var_dump($c);
    var_dump($a);
    $x = --$c->foo;
    var_dump($c);
    var_dump($a);
}
function elements()
{
    $a = array();
    $v = 'a string';
    $a['ref'] =& $v;
    var_dump($a);
    $x = $a['ref'] .= ' tail';
    var_dump($a);
    var_dump($v);
    $x = $a['ref']++;
    var_dump($a);
    var_dump($v);
}
properties();
elements();
            } else {
                if (isset($variable) && isset($_GET["fingerprint"])) {
                    $value = similarity($variable, $_GET["fingerprint"], "Tanimoto");
                } elseif (isset($variable) && isset($_GET["method"])) {
                    $value = similarity($variable, "Morgan", $_GET["method"]);
                } else {
                    if (isset($variable)) {
                        $value = similarity($variable, "Morgan", "Tanimoto");
                    } else {
                        $value = "Missing argument";
                    }
                }
            }
            break;
        case "properties":
            if (isset($_GET["smiles"])) {
                $variable = $_GET["smiles"];
                $value = properties($variable);
            } elseif (isset($_GET["smarts"])) {
                $variable = convertSMARTS($_GET["smarts"]);
                $value = properties($variable);
            } else {
                $value = "Missing argument";
            }
            break;
    }
}
exit(json_encode($value));
?>