From 2087012c1392254ee4fb4aab4b12c97948d06f0f Mon Sep 17 00:00:00 2001 From: LzSkyline Date: Tue, 20 Mar 2018 11:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPHP7=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHP 5.x.x, a break statement outside a for, foreach or switch statement DID NOT throw an error message and was syntactically okay. PHP 7.0 and higher, a break statement is no longer permitted outside a for, foreach or switch statement and gives a fatal error. So I replace break with return false --- CFGGenerator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CFGGenerator.php b/CFGGenerator.php index 7e78c67..3b37e9f 100644 --- a/CFGGenerator.php +++ b/CFGGenerator.php @@ -920,7 +920,7 @@ public function leaveNode(Node $node){ $this->fileSummary->getIncludeMap() ); - if(!$funcBody) break ; + if(!$funcBody) return False ; $cfg = new CFGGenerator() ; //$this->block->function[$nodeName] $arr = $this->sinkContext->getAllSinks() ; @@ -1095,4 +1095,4 @@ public function sinkTracebackBlock($argName,$block,$flowsNum){ -?> \ No newline at end of file +?>