From 1be32fbe17fe0b34fec546087e06044c1fcb32fa Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 29 May 2007 08:58:27 +0000 Subject: [PATCH] fix test --- Zend/tests/019.phpt | 971 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 971 insertions(+) diff --git a/Zend/tests/019.phpt b/Zend/tests/019.phpt index 47158771e6..77e04c41d4 100644 --- a/Zend/tests/019.phpt +++ b/Zend/tests/019.phpt @@ -360,6 +360,7 @@ var_dump($global_var); //Note: No error conditions relating to passing arugments can be tested // because these are not functions but statements, it will result in syntax error. echo "Done\n"; +?> --EXPECTF-- *** Testing unset(), empty() & isset() with scalar variables *** -- Iteration 1 -- @@ -1330,3 +1331,973 @@ bool(false) bool(true) int(10) Done +--UEXPECTF-- +*** Testing unset(), empty() & isset() with scalar variables *** +-- Iteration 1 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 2 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 3 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 4 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 5 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 6 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 7 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 8 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 9 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 10 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 11 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 12 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 13 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 14 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 15 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 16 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 17 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 18 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 19 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 20 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 21 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 22 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 23 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 24 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 25 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 26 -- +bool(true) +bool(true) +bool(false) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) +-- Iteration 27 -- +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: scalar_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +bool(false) +bool(false) + +*** Testing unset(), empty() & isset() with arrays *** +--- Outerloop Iteration 1 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +bool(true) + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 2 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 2 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 3 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 3 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 4 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 4 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 5 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 5 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 6 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 6 -- +array(3) { + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(3) { + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) +} +-- Innerloop Iteration 2 of Outerloop Iteration 6 -- +array(2) { + [2]=> + int(3) + [3]=> + int(4) +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(2) { + [2]=> + int(3) + [3]=> + int(4) +} +-- Innerloop Iteration 3 of Outerloop Iteration 6 -- +array(1) { + [3]=> + int(4) +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(1) { + [3]=> + int(4) +} +-- Innerloop Iteration 4 of Outerloop Iteration 6 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 7 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 7 -- +array(2) { + [1]=> + float(2.5) + [2]=> + float(5.6) +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(2) { + [1]=> + float(2.5) + [2]=> + float(5.6) +} +-- Innerloop Iteration 2 of Outerloop Iteration 7 -- +array(1) { + [2]=> + float(5.6) +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(1) { + [2]=> + float(5.6) +} +-- Innerloop Iteration 3 of Outerloop Iteration 7 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 8 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 8 -- +array(1) { + [2]=> + unicode(3) "two" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(1) { + [2]=> + unicode(3) "two" +} +-- Innerloop Iteration 2 of Outerloop Iteration 8 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 9 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 9 -- +array(1) { + [u"Age"]=> + unicode(2) "30" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(1) { + [u"Age"]=> + unicode(2) "30" +} +-- Innerloop Iteration 2 of Outerloop Iteration 9 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) +--- Outerloop Iteration 10 --- +bool(false) +bool(false) +bool(false) +bool(true) +bool(false) +bool(true) +-- Innerloop Iteration 1 of Outerloop Iteration 10 -- +array(4) { + [1]=> + int(2) + [u"One"]=> + unicode(1) "1" + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(4) { + [1]=> + int(2) + [u"One"]=> + unicode(1) "1" + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} +-- Innerloop Iteration 2 of Outerloop Iteration 10 -- +array(3) { + [u"One"]=> + unicode(1) "1" + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(3) { + [u"One"]=> + unicode(1) "1" + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} +-- Innerloop Iteration 3 of Outerloop Iteration 10 -- +array(2) { + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(2) { + [2]=> + unicode(3) "two" + [u""]=> + unicode(0) "" +} +-- Innerloop Iteration 4 of Outerloop Iteration 10 -- +array(1) { + [u""]=> + unicode(0) "" +} + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(1) { + [u""]=> + unicode(0) "" +} +-- Innerloop Iteration 5 of Outerloop Iteration 10 -- +array(0) { +} + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(false) + +Notice: Undefined variable: key_val in %s on line %d +bool(true) +array(0) { +} + +Notice: Undefined variable: array_var in %s on line %d +NULL +bool(false) +bool(false) +bool(true) + +*** Testing unset(), emtpy() & isset() with resource variables *** +-- Iteration 1 -- +resource(5) of type (stream) +bool(true) +bool(false) +bool(true) +resource(5) of type (stream) +bool(false) +bool(true) +bool(false) +bool(false) + +Notice: Undefined variable: resource in %s on line %d +NULL +-- Iteration 2 -- +resource(6) of type (stream) +bool(true) +bool(false) +bool(true) +resource(6) of type (stream) +bool(false) +bool(true) +bool(false) +bool(false) + +Notice: Undefined variable: resource in %s on line %d +NULL + +Notice: Undefined variable: resources in %s on line %d +NULL +bool(false) +bool(true) + +*** Testing unset(), empty() & isset() with objects *** +object(Point)#1 (3) { + [u"x"]=> + int(30) + [u"y"]=> + int(40) + [u"lable"]=> + NULL +} +bool(true) +bool(false) + +Notice: Undefined variable: lable in %s on line %d +bool(false) + +Notice: Undefined variable: lable in %s on line %d +bool(true) + +Notice: Undefined variable: lable in %s on line %d +bool(false) + +Notice: Undefined variable: lable in %s on line %d +bool(true) +object(Point)#1 (3) { + [u"x"]=> + int(30) + [u"y"]=> + int(40) + [u"lable"]=> + unicode(6) "Point1" +} +object(Point)#1 (2) { + [u"y"]=> + int(40) + [u"lable"]=> + unicode(6) "Point1" +} +bool(false) +bool(true) +object(Point)#1 (0) { +} +bool(true) +bool(false) +bool(false) +bool(true) + +Notice: Undefined variable: point1 in %s on line %d +NULL +bool(false) +bool(true) +bool(false) +bool(true) +array(3) { + [0]=> + unicode(5) "Point" + [1]=> + unicode(8) "setLable" + [2]=> + unicode(9) "testPoint" +} +object(Point)#1 (3) { + [u"x"]=> + int(5) + [u"y"]=> + int(6) + [u"lable"]=> + NULL +} + +*** Testing possible variation in operation for isset(), empty() & unset() *** + +** Testing unset() variation 1: unset on static variable inside a function ** +value of static_var before unset: 1 +bool(true) +bool(false) + +Notice: Undefined variable: static_var in %s on line %d +value of static_var after unset: +bool(false) +bool(true) +value of static_var after new assignment: 20 +value of static_var before unset: 2 +bool(true) +bool(false) + +Notice: Undefined variable: static_var in %s on line %d +value of static_var after unset: +bool(false) +bool(true) +value of static_var after new assignment: 20 +value of static_var before unset: 3 +bool(true) +bool(false) + +Notice: Undefined variable: static_var in %s on line %d +value of static_var after unset: +bool(false) +bool(true) +value of static_var after new assignment: 20 + +** Testing unset() variation 2: unset on a variable passed by ref. inside of a function ** +unicode(5) "value" +bool(false) +bool(true) +unicode(5) "value" + +** Testing unset() variation 3: unset on a global variable inside of a function ** +int(10) +bool(true) +bool(false) +bool(false) +bool(true) +int(10) +Done -- 2.50.1