Browse Source

decompiler: fix argument default value

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@736 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent
commit
8d18908346
  1. 12
      Decompiler.class.php
  2. 23
      decompilesample.php

12
Decompiler.class.php

@ -1557,17 +1557,18 @@ class Decompiler
if ($i) {
echo ', ';
}
$arg = $EX['recvs'][$i + 1];
if (isset($op_array['arg_info'])) {
$ai = $op_array['arg_info'][$i];
if (!empty($ai['class_name'])) {
echo $ai['class_name'], ' ';
if ($ai['allow_null']) {
if (!ZEND_ENGINE_2_2 && $ai['allow_null']) {
echo 'or NULL ';
}
}
else if (!empty($ai['array_type_hint'])) {
echo 'array ';
if ($ai['allow_null']) {
if (!ZEND_ENGINE_2_2 && $ai['allow_null']) {
echo 'or NULL ';
}
}
@ -1596,11 +1597,10 @@ class Decompiler
assert(0);
}
}
$arg = $EX['recvs'][$i + 1];
echo toCode($arg[0], $indent);
if (isset($arg[1])) {
echo ' = ', toCode($arg[1], $indent);
}
}
if (isset($arg[1])) {
echo ' = ', toCode($arg[1], $indent);
}
}
}

23
decompilesample.php

@ -2,39 +2,54 @@
class ClassName
{
/** doc */
static public $static = array(
array('array'),
'str'
);
/** doc */
static public $public_static = array(2, 'str');
/** doc */
static private $private_static = array(2, 'str');
/** doc */
static protected $protected_static = array(2, 'str');
/** doc */
public $property = array(
array('array'),
'str'
);
/** doc */
public $public_property = array(2, 'str');
/** doc */
private $private_property = array(2, 'str');
/** doc */
protected $protected_property = array(2, 'str');
/** doc */
public function __construct($a, $b)
{
}
function method(ClassName $a = null, $b = null)
/** doc */
public function method(array $a = NULL, $b = NULL)
{
}
public function publicMethod(ClassName $a = null, $b = 2)
/** doc */
public function publicMethod(ClassName $a = NULL, $b = 2)
{
}
protected function protectedMethod(ClassName $a, $b = array(array("array")))
/** doc */
protected function protectedMethod(ClassName $a, $b = array(
array('array')
))
{
return 'protected';
}
private function privateMethod(ClassName $a, $b = null)
/** doc */
private function privateMethod(ClassName $a, $b = NULL)
{
return 'private';
}

Loading…
Cancel
Save