diff --git a/Decompiler.class.php b/Decompiler.class.php index 3d02b09..3a7c963 100644 --- a/Decompiler.class.php +++ b/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); } } } diff --git a/decompilesample.php b/decompilesample.php index bc4fea5..ee09196 100644 --- a/decompilesample.php +++ b/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'; }