diff options
Diffstat (limited to 'ext/standard/tests/math/decoct_variation1.phpt')
-rw-r--r-- | ext/standard/tests/math/decoct_variation1.phpt | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/ext/standard/tests/math/decoct_variation1.phpt b/ext/standard/tests/math/decoct_variation1.phpt index 94d385de01..7912566175 100644 --- a/ext/standard/tests/math/decoct_variation1.phpt +++ b/ext/standard/tests/math/decoct_variation1.phpt @@ -78,15 +78,19 @@ $inputs = array( ); // loop through each element of $inputs to check the behaviour of decoct() -$iterator = 1; -foreach($inputs as $input) { +foreach ($inputs as $i => $input) { + $iterator = $i + 1; echo "\n-- Iteration $iterator --\n"; - var_dump(decoct($input)); - $iterator++; -}; + try { + var_dump(decoct($input)); + } catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; + } +} fclose($fp); + ?> ---EXPECTF-- +--EXPECT-- *** Testing decoct() : usage variations *** -- Iteration 1 -- @@ -102,10 +106,10 @@ string(5) "30071" string(11) "37777773327" -- Iteration 5 -- -string(11) "37777777777" +decoct(): Argument #1 ($number) must be of type int, float given -- Iteration 6 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, float given -- Iteration 7 -- string(2) "12" @@ -114,7 +118,7 @@ string(2) "12" string(11) "37777777766" -- Iteration 9 -- -string(11) "27646215010" +decoct(): Argument #1 ($number) must be of type int, float given -- Iteration 10 -- string(1) "0" @@ -141,27 +145,25 @@ string(1) "1" string(1) "0" -- Iteration 18 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, string given -- Iteration 19 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, string given -- Iteration 20 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, array given -- Iteration 21 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, string given -- Iteration 22 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, string given -- Iteration 23 -- -string(1) "0" +decoct(): Argument #1 ($number) must be of type int, string given -- Iteration 24 -- - -Notice: Object of class classA could not be converted to int in %s on line %d -string(1) "1" +decoct(): Argument #1 ($number) must be of type int, classA given -- Iteration 25 -- string(1) "0" @@ -170,4 +172,4 @@ string(1) "0" string(1) "0" -- Iteration 27 -- -string(%d) "%d" +decoct(): Argument #1 ($number) must be of type int, resource given |