return NULL;
}
- if (param->offset < param->required) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
- return NULL;
- }
-
return param;
}
/* }}} */
precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
- zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
+ zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error: Failed to retrieve the default value");
return NULL;
}
var_dump($p->isDefaultValueAvailable());
}
+foreach ($r->getParameters() as $p) {
+ if ($p->isDefaultValueAvailable()) {
+ var_dump($p->getDefaultValue());
+ }
+}
?>
--EXPECT--
bool(true)
bool(true)
bool(false)
+NULL
+int(0)