18f9ec423SDave Kelsey--TEST--
204145dc2SVeres LajosTest function gzfile() by substituting argument 2 with emptyUnsetUndefNull values.
38f9ec423SDave Kelsey--SKIPIF--
48f9ec423SDave Kelsey<?php
58f9ec423SDave Kelseyif (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
68f9ec423SDave Kelsey?>
78f9ec423SDave Kelsey--FILE--
88f9ec423SDave Kelsey<?php
98f9ec423SDave Kelsey
108f9ec423SDave Kelsey
118f9ec423SDave Kelsey$filename = dirname(__FILE__)."/004.txt.gz";
128f9ec423SDave Kelsey
138f9ec423SDave Kelsey
148f9ec423SDave Kelsey$unset_var = 10;
158f9ec423SDave Kelseyunset($unset_var);
168f9ec423SDave Kelsey
178f9ec423SDave Kelsey$variation = array(
188f9ec423SDave Kelsey  'unset var' => @$unset_var,
198f9ec423SDave Kelsey  'undefined var' => @$undefined_var,
208f9ec423SDave Kelsey  'empty string DQ' => "",
218f9ec423SDave Kelsey  'empty string SQ' => '',
228f9ec423SDave Kelsey  'uppercase NULL' => NULL,
238f9ec423SDave Kelsey  'lowercase null' => null,
248f9ec423SDave Kelsey  );
258f9ec423SDave Kelsey
268f9ec423SDave Kelsey
278f9ec423SDave Kelseyforeach ( $variation as $var ) {
288f9ec423SDave Kelsey  var_dump(gzfile( $filename, $var  ) );
298f9ec423SDave Kelsey}
308f9ec423SDave Kelsey?>
318f9ec423SDave Kelsey===DONE===
328f9ec423SDave Kelsey--EXPECTF--
338f9ec423SDave Kelseyarray(6) {
348f9ec423SDave Kelsey  [0]=>
358f9ec423SDave Kelsey  string(36) "When you're taught through feelings
368f9ec423SDave Kelsey"
378f9ec423SDave Kelsey  [1]=>
388f9ec423SDave Kelsey  string(26) "Destiny flying high above
398f9ec423SDave Kelsey"
408f9ec423SDave Kelsey  [2]=>
418f9ec423SDave Kelsey  string(38) "all I know is that you can realize it
428f9ec423SDave Kelsey"
438f9ec423SDave Kelsey  [3]=>
448f9ec423SDave Kelsey  string(18) "Destiny who cares
458f9ec423SDave Kelsey"
468f9ec423SDave Kelsey  [4]=>
478f9ec423SDave Kelsey  string(19) "as it turns around
488f9ec423SDave Kelsey"
498f9ec423SDave Kelsey  [5]=>
508f9ec423SDave Kelsey  string(39) "and I know that it descends down on me
518f9ec423SDave Kelsey"
528f9ec423SDave Kelsey}
538f9ec423SDave Kelseyarray(6) {
548f9ec423SDave Kelsey  [0]=>
558f9ec423SDave Kelsey  string(36) "When you're taught through feelings
568f9ec423SDave Kelsey"
578f9ec423SDave Kelsey  [1]=>
588f9ec423SDave Kelsey  string(26) "Destiny flying high above
598f9ec423SDave Kelsey"
608f9ec423SDave Kelsey  [2]=>
618f9ec423SDave Kelsey  string(38) "all I know is that you can realize it
628f9ec423SDave Kelsey"
638f9ec423SDave Kelsey  [3]=>
648f9ec423SDave Kelsey  string(18) "Destiny who cares
658f9ec423SDave Kelsey"
668f9ec423SDave Kelsey  [4]=>
678f9ec423SDave Kelsey  string(19) "as it turns around
688f9ec423SDave Kelsey"
698f9ec423SDave Kelsey  [5]=>
708f9ec423SDave Kelsey  string(39) "and I know that it descends down on me
718f9ec423SDave Kelsey"
728f9ec423SDave Kelsey}
738f9ec423SDave Kelsey
74ce1d69a1SGabriel CarusoWarning: gzfile() expects parameter 2 to be int, string given in %s on line %d
758f9ec423SDave KelseyNULL
768f9ec423SDave Kelsey
77ce1d69a1SGabriel CarusoWarning: gzfile() expects parameter 2 to be int, string given in %s on line %d
788f9ec423SDave KelseyNULL
798f9ec423SDave Kelseyarray(6) {
808f9ec423SDave Kelsey  [0]=>
818f9ec423SDave Kelsey  string(36) "When you're taught through feelings
828f9ec423SDave Kelsey"
838f9ec423SDave Kelsey  [1]=>
848f9ec423SDave Kelsey  string(26) "Destiny flying high above
858f9ec423SDave Kelsey"
868f9ec423SDave Kelsey  [2]=>
878f9ec423SDave Kelsey  string(38) "all I know is that you can realize it
888f9ec423SDave Kelsey"
898f9ec423SDave Kelsey  [3]=>
908f9ec423SDave Kelsey  string(18) "Destiny who cares
918f9ec423SDave Kelsey"
928f9ec423SDave Kelsey  [4]=>
938f9ec423SDave Kelsey  string(19) "as it turns around
948f9ec423SDave Kelsey"
958f9ec423SDave Kelsey  [5]=>
968f9ec423SDave Kelsey  string(39) "and I know that it descends down on me
978f9ec423SDave Kelsey"
988f9ec423SDave Kelsey}
998f9ec423SDave Kelseyarray(6) {
1008f9ec423SDave Kelsey  [0]=>
1018f9ec423SDave Kelsey  string(36) "When you're taught through feelings
1028f9ec423SDave Kelsey"
1038f9ec423SDave Kelsey  [1]=>
1048f9ec423SDave Kelsey  string(26) "Destiny flying high above
1058f9ec423SDave Kelsey"
1068f9ec423SDave Kelsey  [2]=>
1078f9ec423SDave Kelsey  string(38) "all I know is that you can realize it
1088f9ec423SDave Kelsey"
1098f9ec423SDave Kelsey  [3]=>
1108f9ec423SDave Kelsey  string(18) "Destiny who cares
1118f9ec423SDave Kelsey"
1128f9ec423SDave Kelsey  [4]=>
1138f9ec423SDave Kelsey  string(19) "as it turns around
1148f9ec423SDave Kelsey"
1158f9ec423SDave Kelsey  [5]=>
1168f9ec423SDave Kelsey  string(39) "and I know that it descends down on me
1178f9ec423SDave Kelsey"
1188f9ec423SDave Kelsey}
119b746e698SPeter Kokot===DONE===
120