diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-06-22 10:17:35 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-06-22 10:17:35 +0200 |
commit | db6990a91b2ca931074b29886c7f7819b14bb021 (patch) | |
tree | ae6c760ff8876a4d45f7001ce1f9c7917f169970 /scripts | |
parent | 19fd124bcf2380f8e928795d1fe1900a02635298 (diff) | |
download | php-git-db6990a91b2ca931074b29886c7f7819b14bb021.tar.gz |
Fix genarginfo to respect by-ref passing
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/dev/genarginfo.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/dev/genarginfo.php b/scripts/dev/genarginfo.php index de69f5b045..94c10f8f83 100644 --- a/scripts/dev/genarginfo.php +++ b/scripts/dev/genarginfo.php @@ -38,13 +38,21 @@ if($m) { echo "ZEND_BEGIN_ARG_INFO_EX(arginfo_{$name}, 0, 0, {$required})\n"; } foreach($args as $arg) { - list($type,$name) = explode(' ', $arg, 2); - list($name,) = explode('|', $name, 2); // No |'s in the names - choose the first + list($type, $name) = explode(' ', trim($arg), 2); + list($name) = explode('|', trim($name), 2); // No |'s in the names - choose the first + $name = trim($name); + if ($ref = ($name[0] == "&")) { + $name = trim(substr($name, 1)); + } + list($name, $default) = explode("=", $name, 2); + $name = trim($name); + $allow_null = (int) (trim($default) == "null"); + $ref = (int) $ref; $type=trim($type); if(!empty($types[$type])) { - echo "\tZEND_ARG_TYPE_INFO(0, {$name}, {$types[$type]}, 0)\n"; + echo "\tZEND_ARG_TYPE_INFO($ref, {$name}, {$types[$type]}, $allow_null)\n"; } else { - echo "\tZEND_ARG_INFO(0, {$name})\n"; + echo "\tZEND_ARG_INFO($ref, {$name})\n"; } } echo "ZEND_END_ARG_INFO()\n\n"; |