From ecebbb60949de1d4c992b74e115ab5c6be880e44 Mon Sep 17 00:00:00 2001 From: belliash Date: Fri, 14 Sep 2018 08:36:00 +0200 Subject: [PATCH] Use type hinting in standard library. --- engine/vm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/vm.c b/engine/vm.c index 0de3ca5..983a827 100644 --- a/engine/vm.c +++ b/engine/vm.c @@ -775,7 +775,7 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i "protected $line;"\ "protected $trace;"\ "protected $previous;"\ - "public function __construct($message = null, $code = 0, Exception $previous = null){"\ + "public function __construct(string $message = '', int $code = 0, Exception $previous = null){"\ " if( isset($message) ){"\ " $this->message = $message;"\ " }"\ @@ -814,7 +814,7 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i "}"\ "class ErrorException extends Exception { "\ "protected $severity;"\ - "public function __construct(string $message = null,"\ + "public function __construct(string $message = '',"\ "int $code = 0,int $severity = 1,string $filename = __FILE__ ,int $lineno = __LINE__ ,Exception $previous = null){"\ " if( isset($message) ){"\ " $this->message = $message;"\ @@ -884,7 +884,7 @@ static sxi32 VmEvalChunk(ph7_vm *pVm, ph7_context *pCtx, SyString *pChunk, int i " public function __toBool(){ return (bool)$this->value; }"\ " public function __toFloat(){ return (float)$this->value; }"\ " public function __toString(){ return (string)$this->value; }"\ - " function __construct($v){ $this->value = $v; }"\ + " function __construct(mixed $v){ $this->value = $v; }"\ "}" /*