|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-11-16 01:35 UTC] requinix@php.net
-Status: Open
+Status: Feedback
-Package: PHP Language Specification
+Package: *General Issues
[2019-11-16 01:35 UTC] requinix@php.net
[2019-11-16 11:55 UTC] rowan dot collins at gmail dot com
[2019-11-16 17:36 UTC] mail-roboczy-dla-forow at wp dot pl
[2019-11-17 11:54 UTC] cmb@php.net
[2019-11-17 11:54 UTC] cmb@php.net
-Status: Feedback
+Status: Suspended
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 02:00:01 2025 UTC |
Description: ------------ function analyze($anyParameter) { foreach($anyParameter as &$v) b($v); } function b(&$obj) { foreach($obj as $line) { $res=c($line); } if(...) { ... $res=b(substr($line,3)); /* recurrent function */ ... } ... } function c(&$line) { if($line=='1') return 3; if($line=='2') return 4; if($line=='unexpected data') [analyze] return false; /* return from previous calls and return 'false' from 'analyze' function and continue execution from next instruction after last 'analyze' call. */ return -1; } Test script: --------------- No test script, the functionality will help faster return from multiple calls, for example analyzing jpeg, gif or odt files. It is the common situation that the analyzing function identyify unexpected data and the analysis must by broken due to nonsense data and returns error code. It is possible to write code without this enhancement but the code will be longer and will contain additional conditions slowing execution of multiple nested calls. Expected result: ---------------- additional syntax [functionName] return result;