3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( 1, 2, 3 ); $maxRetries = 5; class RetryIterator { protected static $_currentRetries = 0; public static function iterate($element) { var_dump($element); var_dump(func_get_args()); if ($element == 2) { throw new Exception('Something went wrong'); } } public static function handleException($e, $array) { var_dump(func_get_args()); var_dump('Exception handled'); } public static function retry(&$array, $maxRetries, $iterateCallback, $handleCallback, $iterateParams = null, $handleParams = null, $iterateCallbackObject = null, $handleCallbackObject = null) { while (!empty($array)) { reset($array); $key = key($array); try { if (!is_object($iterateCallbackObject)) { if (is_array($iterateParams) && !empty($iterateParams)) { array_unshift($handleParams, $array[$key]); call_user_func_array($iterateCallback, $iterateParams); } else { call_user_func($iterateCallback, ($array[$key])); } } else { if (is_array($iterateParams) && !empty($iterateParams)) { array_unshift($handleParams, $array[$key]); call_user_func_array(array($iterateCallbackObject, $iterateCallback), $iterateParams); } else { $iterateCallbackObject->$iterateCallback($array[$key]); } } unset($array[$key]); } catch (Exception $e) { static::$_currentRetries++; if (static::$_currentRetries <= $maxRetries) { if (!is_object($handleCallbackObject)) { if (is_array($handleParams) && !empty($handleParams)) { array_unshift($handleParams, $e, $array); call_user_func_array($handleCallback, $handleParams); } else { call_user_func($handleCallback, $e, $array); } } else { if (is_array($handleParams) && !empty($handleParams)) { array_unshift($handleParams, $e, $array); call_user_func_array(array($handleCallbackObject, $handleCallback), $handleParams); } else { $handleCallbackObject->$handleCallback($e, $array); } } } else { throw new Exception('maxRetries reached'); } } } } } class Foo { public function bar($el, $a = null, $b = null, $c = null) { var_dump(func_get_args()); var_dump($el); if ($el == 2) { throw new Exception('Exception'); } } public function handle($e, $arr, $a = null, $b = null, $c = null) { var_dump(func_get_args()); var_dump('Exception handled'); } } try { RetryIterator::retry($arr, 5, 'RetryIterator::iterate', 'RetryIterator::handleException'); } catch (Exception $e) { } $arr = array(1, false, 2, 3); $foo = new Foo(); try { RetryIterator::retry($arr, 5, 'bar', 'handle', null, null, $foo, $foo); } catch (Exception $e) { } $arr = array(1, false, 2, 3); $foo = new Foo(); try { RetryIterator::retry($arr, 5, 'bar', 'handle', array(1, 2, 3), array(1, 2, 3), $foo, $foo); } catch (Exception $e) { }
Output for 7.0.0 - 7.1.0
int(1) array(1) { [0]=> int(1) } int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(1) { [0]=> int(1) } int(1) array(1) { [0]=> bool(false) } bool(false) array(1) { [0]=> int(2) } int(2) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1)
Output for hhvm-3.12.0
int(1) array(1) { [0]=> int(1) } int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#3 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#4 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#5 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(1) { [0]=> int(1) } int(1) array(1) { [0]=> bool(false) } bool(false) array(1) { [0]=> int(2) } int(2) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1)
Output for hhvm-3.10.0
int(1) array(1) { [0]=> int(1) } int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#3 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#4 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#5 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(-1) ["trace":"Exception":private]=> array(2) { [0]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(-1) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> array(2) { [1]=> int(2) [2]=> int(3) } [1]=> int(5) [2]=> string(22) "RetryIterator::iterate" [3]=> string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(1) { [0]=> int(1) } int(1) array(1) { [0]=> bool(false) } bool(false) array(1) { [0]=> int(2) } int(2) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1)
Output for 5.3.0 - 5.6.28
int(1) array(1) { [0]=> int(1) } int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(3) { [0]=> array(4) { ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(4) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(14) "call_user_func" ["args"]=> array(2) { [0]=> string(22) "RetryIterator::iterate" [1]=> int(2) } } [2]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> &int(5) [2]=> &string(22) "RetryIterator::iterate" [3]=> &string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(3) { [0]=> array(4) { ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(4) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(14) "call_user_func" ["args"]=> array(2) { [0]=> string(22) "RetryIterator::iterate" [1]=> int(2) } } [2]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> &int(5) [2]=> &string(22) "RetryIterator::iterate" [3]=> &string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(3) { [0]=> array(4) { ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(4) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(14) "call_user_func" ["args"]=> array(2) { [0]=> string(22) "RetryIterator::iterate" [1]=> int(2) } } [2]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> &int(5) [2]=> &string(22) "RetryIterator::iterate" [3]=> &string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#2 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(3) { [0]=> array(4) { ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(4) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(14) "call_user_func" ["args"]=> array(2) { [0]=> string(22) "RetryIterator::iterate" [1]=> int(2) } } [2]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> &int(5) [2]=> &string(22) "RetryIterator::iterate" [3]=> &string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(2) { [0]=> object(Exception)#1 (7) { ["message":protected]=> string(20) "Something went wrong" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(9) "/in/R6JUC" ["line":protected]=> int(14) ["trace":"Exception":private]=> array(3) { [0]=> array(4) { ["function"]=> string(7) "iterate" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> int(2) } } [1]=> array(4) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(33) ["function"]=> string(14) "call_user_func" ["args"]=> array(2) { [0]=> string(22) "RetryIterator::iterate" [1]=> int(2) } } [2]=> array(6) { ["file"]=> string(9) "/in/R6JUC" ["line"]=> int(86) ["function"]=> string(5) "retry" ["class"]=> string(13) "RetryIterator" ["type"]=> string(2) "::" ["args"]=> array(4) { [0]=> &array(2) { [1]=> int(2) [2]=> int(3) } [1]=> &int(5) [2]=> &string(22) "RetryIterator::iterate" [3]=> &string(30) "RetryIterator::handleException" } } } ["previous":"Exception":private]=> NULL } [1]=> array(2) { [1]=> int(2) [2]=> int(3) } } string(17) "Exception handled" int(2) array(1) { [0]=> int(2) } array(1) { [0]=> int(1) } int(1) array(1) { [0]=> bool(false) } bool(false) array(1) { [0]=> int(2) } int(2) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1) array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } int(1)
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/R6JUC on line 45
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/R6JUC on line 45
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/R6JUC on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/R6JUC on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/R6JUC on line 8
Process exited with code 255.