1--TEST--
2Test var_dump() function
3--SKIPIF--
4<?php
5if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
6?>
7--INI--
8precision=14
9--FILE--
10<?php
11/* Prototype: void var_dump ( mixed $expression [, mixed $expression [, $...]] );
12   Description: Displays structured information about one or more expressions that includes its type and value.
13*/
14
15/* Prototype: void check_vardump( $variables );
16   Description: use var_dump() to display the variables */
17function check_vardump( $variables ) {
18  $counter = 1;
19  foreach( $variables as $variable ) {
20    echo "-- Iteration $counter --\n";
21    var_dump($variable);
22    $counter++;
23  }
24}
25
26echo "\n*** Testing var_dump() on integer variables ***\n";
27$integers = array (
28  0,  // zero as argument
29  000000123,  //octal value of 83
30  123000000,
31  -00000123,  //octal value of 83
32  -12300000,
33  range(1,10),  // positive values
34  range(-1,-10),  // negative values
35  +2147483647,  // max positive integer
36  +2147483648,  // max positive integer + 1
37  -2147483648,  // min range of integer
38  -2147483647,  // min range of integer + 1
39  0x7FFFFFFF,  // max positive hexadecimal integer
40  -0x80000000,  // min range of hexadecimal integer
41  017777777777,  // max posotive octal integer
42  -020000000000  // min range of octal integer
43);
44/* calling check_vardump() to display contents of integer variables
45   using var_dump() */
46check_vardump($integers);
47
48echo "\n*** Testing var_dump() on float variables ***\n";
49$floats = array (
50  -0.0,
51  +0.0,
52  1.234,
53  -1.234,
54  -2.000000,
55  000002.00,
56  -.5,
57  .567,
58  -.6700000e-3,
59  -.6700000E+3,
60  .6700000E+3,
61  .6700000e+3,
62  -4.10003e-3,
63  -4.10003E+3,
64  4.100003e-3,
65  4.100003E+3,
66  1e5,
67  -1e5,
68  1e-5,
69  -1e-5,
70  1e+5,
71  -1e+5,
72  1E5,
73  -1E5,
74  1E+5,
75  -1E+5,
76  1E-5,
77  -1E-5,
78  -0x80000001,  // float value, beyond max negative int
79  0x80000001,  // float value, beyond max positive int
80  020000000001,  // float value, beyond max positive int
81  -020000000001  // float value, beyond max negative int
82);
83/* calling check_vardump() to display contents of float variables
84   using var_dump() */
85check_vardump($floats);
86
87echo "\n*** Testing var_dump() on string variables ***\n";
88$strings = array (
89  "",
90  '',
91  " ",
92  ' ',
93  "0",
94  "\0",
95  '\0',
96  "\t",
97  '\t',
98  "PHP",
99  'PHP',
100  "abcd\x0n1234\x0005678\x0000efgh\xijkl",  // strings with hexadecimal NULL
101  "abcd\0efgh\0ijkl\x00mnop\x000qrst\00uvwx\0000yz",  // strings with octal NULL
102  "1234\t\n5678\n\t9100\rabcda"  // strings with escape characters
103);
104/* calling check_vardump() to display contents of strings
105   using var_dump() */
106check_vardump($strings);
107
108echo "\n*** Testing var_dump() on boolean variables ***\n";
109$booleans = array (
110  TRUE,
111  FALSE,
112  true,
113  false
114);
115/* calling check_vardump() to display boolean variables
116   using var_dump() */
117check_vardump($booleans);
118
119echo "\n*** Testing var_dump() on array variables ***\n";
120$arrays = array (
121  array(),
122  array(NULL),
123  array(null),
124  array(true),
125  array(""),
126  array(''),
127  array(array(), array()),
128  array(array(1, 2), array('a', 'b')),
129  array(1 => 'One'),
130  array("test" => "is_array"),
131  array(0),
132  array(-1),
133  array(10.5, 5.6),
134  array("string", "test"),
135  array('string', 'test'),
136);
137/* calling check_vardump() to display contents of an array
138   using var_dump() */
139check_vardump($arrays);
140
141echo "\n*** Testing var_dump() on object variables ***\n";
142class object_class
143{
144  var       $value;
145  public    $public_var1 = 10;
146  private   $private_var1 = 20;
147  private   $private_var2;
148  protected $protected_var1 = "string_1";
149  protected $protected_var2;
150
151  function object_class ( ) {
152    $this->value = 50;
153    $this->public_var2 = 11;
154    $this->private_var2 = 21;
155    $this->protected_var2 = "string_2";
156  }
157
158  public function foo1() {
159    echo "foo1() is called\n";
160  }
161  protected function foo2() {
162    echo "foo2() is called\n";
163  }
164  private function foo3() {
165    echo "foo3() is called\n";
166  }
167}
168/* class with no member */
169class no_member_class {
170 // no members
171}
172
173/* class with member as object of other class */
174class contains_object_class
175{
176   var       $p = 30;
177   var       $class_object1;
178   public    $class_object2;
179   private   $class_object3;
180   protected $class_object4;
181   var       $no_member_class_object;
182
183   public function func() {
184     echo "func() is called \n";
185   }
186
187   function contains_object_class () {
188     $this->class_object1 = new object_class();
189     $this->class_object2 = new object_class();
190     $this->class_object3 = $this->class_object1;
191     $this->class_object4 = $this->class_object2;
192     $this->no_member_class_object = new no_member_class();
193     $this->class_object5 = $this;   //recursive reference
194   }
195}
196
197/* objects of different classes */
198$obj = new contains_object_class;
199$temp_class_obj = new object_class();
200
201/* object which is unset */
202$unset_obj = new object_class();
203unset($unset_obj);
204
205$objects = array (
206  new object_class,
207  new no_member_class,
208  new contains_object_class,
209  $obj,
210  $obj->class_object1,
211  $obj->class_object2,
212  $obj->no_member_class_object,
213  $temp_class_obj,
214  @$unset_obj
215);
216/* calling check_vardump() to display contents of the objects
217   using var_dump() */
218check_vardump($objects);
219
220echo "\n** Testing var_dump() on objects having circular reference **\n";
221$recursion_obj1 = new object_class();
222$recursion_obj2 = new object_class();
223$recursion_obj1->obj = &$recursion_obj2;  //circular reference
224$recursion_obj2->obj = &$recursion_obj1;  //circular reference
225var_dump($recursion_obj2);
226
227echo "\n*** Testing var_dump() on resources ***\n";
228/* file type resource */
229$file_handle = fopen(__FILE__, "r");
230
231/* directory type resource */
232$dir_handle = opendir( dirname(__FILE__) );
233
234$resources = array (
235  $file_handle,
236  $dir_handle
237);
238/* calling check_vardump() to display the resource content type
239   using var_dump() */
240check_vardump($resources);
241
242echo "\n*** Testing var_dump() on different combinations of scalar
243            and non-scalar variables ***\n";
244/* a variable which is unset */
245$unset_var = 10.5;
246unset($unset_var);
247
248/* unset file type resource */
249unset($file_handle);
250
251$variations = array (
252  array( 123, -1.2345, "a" ),
253  array( "d", array(1, 3, 5), true, null),
254  array( new no_member_class, array(), false, 0 ),
255  array( -0.00, "Where am I?", array(7,8,9), TRUE, 'A', 987654321 ),
256  array( @$unset_var, 2.E+10, 100-20.9, 000004.599998 ),  //unusual data
257  array( "array(1,2,3,4)1.0000002TRUE", @$file_handle, 111333.00+45e5, '/00\7')
258);
259/* calling check_vardump() to display combinations of scalar and
260   non-scalar variables using var_dump() */
261check_vardump($variations);
262
263echo "\n*** Testing var_dump() on miscelleneous input arguments ***\n";
264$misc_values = array (
265  @$unset_var,
266  NULL,  // NULL argument
267  @$undef_variable,  //undefined variable
268  null
269);
270/* calling check_vardump() to display miscelleneous data using var_dump() */
271check_vardump($misc_values);
272
273echo "\n*** Testing var_dump() on multiple arguments ***\n";
274var_dump( $integers, $floats, $strings, $arrays, $booleans, $resources,
275          $objects, $misc_values, $variations );
276
277/* checking var_dump() on functions */
278echo "\n*** Testing var_dump() on anonymous functions ***\n";
279$newfunc = create_function('$a,$b', 'return "$a * $b = " . ($a * $b);');
280echo "New anonymous function: $newfunc\n";
281var_dump( $newfunc(2, 3) );
282/* creating anonymous function dynamically */
283var_dump( create_function('$a', 'return "$a * $a = " . ($a * $b);') );
284
285echo "\n*** Testing error conditions ***\n";
286//passing zero argument
287var_dump();
288
289/* closing resource handle used */
290closedir($dir_handle);
291
292echo "Done\n";
293?>
294--EXPECTF--
295*** Testing var_dump() on integer variables ***
296-- Iteration 1 --
297int(0)
298-- Iteration 2 --
299int(83)
300-- Iteration 3 --
301int(123000000)
302-- Iteration 4 --
303int(-83)
304-- Iteration 5 --
305int(-12300000)
306-- Iteration 6 --
307array(10) {
308  [0]=>
309  int(1)
310  [1]=>
311  int(2)
312  [2]=>
313  int(3)
314  [3]=>
315  int(4)
316  [4]=>
317  int(5)
318  [5]=>
319  int(6)
320  [6]=>
321  int(7)
322  [7]=>
323  int(8)
324  [8]=>
325  int(9)
326  [9]=>
327  int(10)
328}
329-- Iteration 7 --
330array(10) {
331  [0]=>
332  int(-1)
333  [1]=>
334  int(-2)
335  [2]=>
336  int(-3)
337  [3]=>
338  int(-4)
339  [4]=>
340  int(-5)
341  [5]=>
342  int(-6)
343  [6]=>
344  int(-7)
345  [7]=>
346  int(-8)
347  [8]=>
348  int(-9)
349  [9]=>
350  int(-10)
351}
352-- Iteration 8 --
353int(2147483647)
354-- Iteration 9 --
355float(2147483648)
356-- Iteration 10 --
357float(-2147483648)
358-- Iteration 11 --
359int(-2147483647)
360-- Iteration 12 --
361int(2147483647)
362-- Iteration 13 --
363float(-2147483648)
364-- Iteration 14 --
365int(2147483647)
366-- Iteration 15 --
367float(-2147483648)
368
369*** Testing var_dump() on float variables ***
370-- Iteration 1 --
371float(0)
372-- Iteration 2 --
373float(0)
374-- Iteration 3 --
375float(1.234)
376-- Iteration 4 --
377float(-1.234)
378-- Iteration 5 --
379float(-2)
380-- Iteration 6 --
381float(2)
382-- Iteration 7 --
383float(-0.5)
384-- Iteration 8 --
385float(0.567)
386-- Iteration 9 --
387float(-0.00067)
388-- Iteration 10 --
389float(-670)
390-- Iteration 11 --
391float(670)
392-- Iteration 12 --
393float(670)
394-- Iteration 13 --
395float(-0.00410003)
396-- Iteration 14 --
397float(-4100.03)
398-- Iteration 15 --
399float(0.004100003)
400-- Iteration 16 --
401float(4100.003)
402-- Iteration 17 --
403float(100000)
404-- Iteration 18 --
405float(-100000)
406-- Iteration 19 --
407float(1.0E-5)
408-- Iteration 20 --
409float(-1.0E-5)
410-- Iteration 21 --
411float(100000)
412-- Iteration 22 --
413float(-100000)
414-- Iteration 23 --
415float(100000)
416-- Iteration 24 --
417float(-100000)
418-- Iteration 25 --
419float(100000)
420-- Iteration 26 --
421float(-100000)
422-- Iteration 27 --
423float(1.0E-5)
424-- Iteration 28 --
425float(-1.0E-5)
426-- Iteration 29 --
427float(-2147483649)
428-- Iteration 30 --
429float(2147483649)
430-- Iteration 31 --
431float(2147483649)
432-- Iteration 32 --
433float(-2147483649)
434
435*** Testing var_dump() on string variables ***
436-- Iteration 1 --
437string(0) ""
438-- Iteration 2 --
439string(0) ""
440-- Iteration 3 --
441string(1) " "
442-- Iteration 4 --
443string(1) " "
444-- Iteration 5 --
445string(1) "0"
446-- Iteration 6 --
447string(1) "�"
448-- Iteration 7 --
449string(2) "\0"
450-- Iteration 8 --
451string(1) "	"
452-- Iteration 9 --
453string(2) "\t"
454-- Iteration 10 --
455string(3) "PHP"
456-- Iteration 11 --
457string(3) "PHP"
458-- Iteration 12 --
459string(29) "abcd�n1234�05678�00efgh\xijkl"
460-- Iteration 13 --
461string(34) "abcd�efgh�ijkl�mnop�0qrst�uvwx�0yz"
462-- Iteration 14 --
463string(22) "1234
4645678
465	9100
465abcda"
466
467*** Testing var_dump() on boolean variables ***
468-- Iteration 1 --
469bool(true)
470-- Iteration 2 --
471bool(false)
472-- Iteration 3 --
473bool(true)
474-- Iteration 4 --
475bool(false)
476
477*** Testing var_dump() on array variables ***
478-- Iteration 1 --
479array(0) {
480}
481-- Iteration 2 --
482array(1) {
483  [0]=>
484  NULL
485}
486-- Iteration 3 --
487array(1) {
488  [0]=>
489  NULL
490}
491-- Iteration 4 --
492array(1) {
493  [0]=>
494  bool(true)
495}
496-- Iteration 5 --
497array(1) {
498  [0]=>
499  string(0) ""
500}
501-- Iteration 6 --
502array(1) {
503  [0]=>
504  string(0) ""
505}
506-- Iteration 7 --
507array(2) {
508  [0]=>
509  array(0) {
510  }
511  [1]=>
512  array(0) {
513  }
514}
515-- Iteration 8 --
516array(2) {
517  [0]=>
518  array(2) {
519    [0]=>
520    int(1)
521    [1]=>
522    int(2)
523  }
524  [1]=>
525  array(2) {
526    [0]=>
527    string(1) "a"
528    [1]=>
529    string(1) "b"
530  }
531}
532-- Iteration 9 --
533array(1) {
534  [1]=>
535  string(3) "One"
536}
537-- Iteration 10 --
538array(1) {
539  ["test"]=>
540  string(8) "is_array"
541}
542-- Iteration 11 --
543array(1) {
544  [0]=>
545  int(0)
546}
547-- Iteration 12 --
548array(1) {
549  [0]=>
550  int(-1)
551}
552-- Iteration 13 --
553array(2) {
554  [0]=>
555  float(10.5)
556  [1]=>
557  float(5.6)
558}
559-- Iteration 14 --
560array(2) {
561  [0]=>
562  string(6) "string"
563  [1]=>
564  string(4) "test"
565}
566-- Iteration 15 --
567array(2) {
568  [0]=>
569  string(6) "string"
570  [1]=>
571  string(4) "test"
572}
573
574*** Testing var_dump() on object variables ***
575-- Iteration 1 --
576object(object_class)#6 (7) {
577  ["value"]=>
578  int(50)
579  ["public_var1"]=>
580  int(10)
581  ["private_var1":"object_class":private]=>
582  int(20)
583  ["private_var2":"object_class":private]=>
584  int(21)
585  ["protected_var1":protected]=>
586  string(8) "string_1"
587  ["protected_var2":protected]=>
588  string(8) "string_2"
589  ["public_var2"]=>
590  int(11)
591}
592-- Iteration 2 --
593object(no_member_class)#7 (0) {
594}
595-- Iteration 3 --
596object(contains_object_class)#8 (7) {
597  ["p"]=>
598  int(30)
599  ["class_object1"]=>
600  object(object_class)#9 (7) {
601    ["value"]=>
602    int(50)
603    ["public_var1"]=>
604    int(10)
605    ["private_var1":"object_class":private]=>
606    int(20)
607    ["private_var2":"object_class":private]=>
608    int(21)
609    ["protected_var1":protected]=>
610    string(8) "string_1"
611    ["protected_var2":protected]=>
612    string(8) "string_2"
613    ["public_var2"]=>
614    int(11)
615  }
616  ["class_object2"]=>
617  object(object_class)#10 (7) {
618    ["value"]=>
619    int(50)
620    ["public_var1"]=>
621    int(10)
622    ["private_var1":"object_class":private]=>
623    int(20)
624    ["private_var2":"object_class":private]=>
625    int(21)
626    ["protected_var1":protected]=>
627    string(8) "string_1"
628    ["protected_var2":protected]=>
629    string(8) "string_2"
630    ["public_var2"]=>
631    int(11)
632  }
633  ["class_object3":"contains_object_class":private]=>
634  object(object_class)#9 (7) {
635    ["value"]=>
636    int(50)
637    ["public_var1"]=>
638    int(10)
639    ["private_var1":"object_class":private]=>
640    int(20)
641    ["private_var2":"object_class":private]=>
642    int(21)
643    ["protected_var1":protected]=>
644    string(8) "string_1"
645    ["protected_var2":protected]=>
646    string(8) "string_2"
647    ["public_var2"]=>
648    int(11)
649  }
650  ["class_object4":protected]=>
651  object(object_class)#10 (7) {
652    ["value"]=>
653    int(50)
654    ["public_var1"]=>
655    int(10)
656    ["private_var1":"object_class":private]=>
657    int(20)
658    ["private_var2":"object_class":private]=>
659    int(21)
660    ["protected_var1":protected]=>
661    string(8) "string_1"
662    ["protected_var2":protected]=>
663    string(8) "string_2"
664    ["public_var2"]=>
665    int(11)
666  }
667  ["no_member_class_object"]=>
668  object(no_member_class)#11 (0) {
669  }
670  ["class_object5"]=>
671  *RECURSION*
672}
673-- Iteration 4 --
674object(contains_object_class)#1 (7) {
675  ["p"]=>
676  int(30)
677  ["class_object1"]=>
678  object(object_class)#2 (7) {
679    ["value"]=>
680    int(50)
681    ["public_var1"]=>
682    int(10)
683    ["private_var1":"object_class":private]=>
684    int(20)
685    ["private_var2":"object_class":private]=>
686    int(21)
687    ["protected_var1":protected]=>
688    string(8) "string_1"
689    ["protected_var2":protected]=>
690    string(8) "string_2"
691    ["public_var2"]=>
692    int(11)
693  }
694  ["class_object2"]=>
695  object(object_class)#3 (7) {
696    ["value"]=>
697    int(50)
698    ["public_var1"]=>
699    int(10)
700    ["private_var1":"object_class":private]=>
701    int(20)
702    ["private_var2":"object_class":private]=>
703    int(21)
704    ["protected_var1":protected]=>
705    string(8) "string_1"
706    ["protected_var2":protected]=>
707    string(8) "string_2"
708    ["public_var2"]=>
709    int(11)
710  }
711  ["class_object3":"contains_object_class":private]=>
712  object(object_class)#2 (7) {
713    ["value"]=>
714    int(50)
715    ["public_var1"]=>
716    int(10)
717    ["private_var1":"object_class":private]=>
718    int(20)
719    ["private_var2":"object_class":private]=>
720    int(21)
721    ["protected_var1":protected]=>
722    string(8) "string_1"
723    ["protected_var2":protected]=>
724    string(8) "string_2"
725    ["public_var2"]=>
726    int(11)
727  }
728  ["class_object4":protected]=>
729  object(object_class)#3 (7) {
730    ["value"]=>
731    int(50)
732    ["public_var1"]=>
733    int(10)
734    ["private_var1":"object_class":private]=>
735    int(20)
736    ["private_var2":"object_class":private]=>
737    int(21)
738    ["protected_var1":protected]=>
739    string(8) "string_1"
740    ["protected_var2":protected]=>
741    string(8) "string_2"
742    ["public_var2"]=>
743    int(11)
744  }
745  ["no_member_class_object"]=>
746  object(no_member_class)#4 (0) {
747  }
748  ["class_object5"]=>
749  *RECURSION*
750}
751-- Iteration 5 --
752object(object_class)#2 (7) {
753  ["value"]=>
754  int(50)
755  ["public_var1"]=>
756  int(10)
757  ["private_var1":"object_class":private]=>
758  int(20)
759  ["private_var2":"object_class":private]=>
760  int(21)
761  ["protected_var1":protected]=>
762  string(8) "string_1"
763  ["protected_var2":protected]=>
764  string(8) "string_2"
765  ["public_var2"]=>
766  int(11)
767}
768-- Iteration 6 --
769object(object_class)#3 (7) {
770  ["value"]=>
771  int(50)
772  ["public_var1"]=>
773  int(10)
774  ["private_var1":"object_class":private]=>
775  int(20)
776  ["private_var2":"object_class":private]=>
777  int(21)
778  ["protected_var1":protected]=>
779  string(8) "string_1"
780  ["protected_var2":protected]=>
781  string(8) "string_2"
782  ["public_var2"]=>
783  int(11)
784}
785-- Iteration 7 --
786object(no_member_class)#4 (0) {
787}
788-- Iteration 8 --
789object(object_class)#5 (7) {
790  ["value"]=>
791  int(50)
792  ["public_var1"]=>
793  int(10)
794  ["private_var1":"object_class":private]=>
795  int(20)
796  ["private_var2":"object_class":private]=>
797  int(21)
798  ["protected_var1":protected]=>
799  string(8) "string_1"
800  ["protected_var2":protected]=>
801  string(8) "string_2"
802  ["public_var2"]=>
803  int(11)
804}
805-- Iteration 9 --
806NULL
807
808** Testing var_dump() on objects having circular reference **
809object(object_class)#13 (8) {
810  ["value"]=>
811  int(50)
812  ["public_var1"]=>
813  int(10)
814  ["private_var1":"object_class":private]=>
815  int(20)
816  ["private_var2":"object_class":private]=>
817  int(21)
818  ["protected_var1":protected]=>
819  string(8) "string_1"
820  ["protected_var2":protected]=>
821  string(8) "string_2"
822  ["public_var2"]=>
823  int(11)
824  ["obj"]=>
825  &object(object_class)#12 (8) {
826    ["value"]=>
827    int(50)
828    ["public_var1"]=>
829    int(10)
830    ["private_var1":"object_class":private]=>
831    int(20)
832    ["private_var2":"object_class":private]=>
833    int(21)
834    ["protected_var1":protected]=>
835    string(8) "string_1"
836    ["protected_var2":protected]=>
837    string(8) "string_2"
838    ["public_var2"]=>
839    int(11)
840    ["obj"]=>
841    *RECURSION*
842  }
843}
844
845*** Testing var_dump() on resources ***
846-- Iteration 1 --
847resource(%d) of type (stream)
848-- Iteration 2 --
849resource(%d) of type (stream)
850
851*** Testing var_dump() on different combinations of scalar
852            and non-scalar variables ***
853-- Iteration 1 --
854array(3) {
855  [0]=>
856  int(123)
857  [1]=>
858  float(-1.2345)
859  [2]=>
860  string(1) "a"
861}
862-- Iteration 2 --
863array(4) {
864  [0]=>
865  string(1) "d"
866  [1]=>
867  array(3) {
868    [0]=>
869    int(1)
870    [1]=>
871    int(3)
872    [2]=>
873    int(5)
874  }
875  [2]=>
876  bool(true)
877  [3]=>
878  NULL
879}
880-- Iteration 3 --
881array(4) {
882  [0]=>
883  object(no_member_class)#14 (0) {
884  }
885  [1]=>
886  array(0) {
887  }
888  [2]=>
889  bool(false)
890  [3]=>
891  int(0)
892}
893-- Iteration 4 --
894array(6) {
895  [0]=>
896  float(0)
897  [1]=>
898  string(11) "Where am I?"
899  [2]=>
900  array(3) {
901    [0]=>
902    int(7)
903    [1]=>
904    int(8)
905    [2]=>
906    int(9)
907  }
908  [3]=>
909  bool(true)
910  [4]=>
911  string(1) "A"
912  [5]=>
913  int(987654321)
914}
915-- Iteration 5 --
916array(4) {
917  [0]=>
918  NULL
919  [1]=>
920  float(20000000000)
921  [2]=>
922  float(79.1)
923  [3]=>
924  float(4.599998)
925}
926-- Iteration 6 --
927array(4) {
928  [0]=>
929  string(27) "array(1,2,3,4)1.0000002TRUE"
930  [1]=>
931  NULL
932  [2]=>
933  float(4611333)
934  [3]=>
935  string(5) "/00\7"
936}
937
938*** Testing var_dump() on miscelleneous input arguments ***
939-- Iteration 1 --
940NULL
941-- Iteration 2 --
942NULL
943-- Iteration 3 --
944NULL
945-- Iteration 4 --
946NULL
947
948*** Testing var_dump() on multiple arguments ***
949array(15) {
950  [0]=>
951  int(0)
952  [1]=>
953  int(83)
954  [2]=>
955  int(123000000)
956  [3]=>
957  int(-83)
958  [4]=>
959  int(-12300000)
960  [5]=>
961  array(10) {
962    [0]=>
963    int(1)
964    [1]=>
965    int(2)
966    [2]=>
967    int(3)
968    [3]=>
969    int(4)
970    [4]=>
971    int(5)
972    [5]=>
973    int(6)
974    [6]=>
975    int(7)
976    [7]=>
977    int(8)
978    [8]=>
979    int(9)
980    [9]=>
981    int(10)
982  }
983  [6]=>
984  array(10) {
985    [0]=>
986    int(-1)
987    [1]=>
988    int(-2)
989    [2]=>
990    int(-3)
991    [3]=>
992    int(-4)
993    [4]=>
994    int(-5)
995    [5]=>
996    int(-6)
997    [6]=>
998    int(-7)
999    [7]=>
1000    int(-8)
1001    [8]=>
1002    int(-9)
1003    [9]=>
1004    int(-10)
1005  }
1006  [7]=>
1007  int(2147483647)
1008  [8]=>
1009  float(2147483648)
1010  [9]=>
1011  float(-2147483648)
1012  [10]=>
1013  int(-2147483647)
1014  [11]=>
1015  int(2147483647)
1016  [12]=>
1017  float(-2147483648)
1018  [13]=>
1019  int(2147483647)
1020  [14]=>
1021  float(-2147483648)
1022}
1023array(32) {
1024  [0]=>
1025  float(0)
1026  [1]=>
1027  float(0)
1028  [2]=>
1029  float(1.234)
1030  [3]=>
1031  float(-1.234)
1032  [4]=>
1033  float(-2)
1034  [5]=>
1035  float(2)
1036  [6]=>
1037  float(-0.5)
1038  [7]=>
1039  float(0.567)
1040  [8]=>
1041  float(-0.00067)
1042  [9]=>
1043  float(-670)
1044  [10]=>
1045  float(670)
1046  [11]=>
1047  float(670)
1048  [12]=>
1049  float(-0.00410003)
1050  [13]=>
1051  float(-4100.03)
1052  [14]=>
1053  float(0.004100003)
1054  [15]=>
1055  float(4100.003)
1056  [16]=>
1057  float(100000)
1058  [17]=>
1059  float(-100000)
1060  [18]=>
1061  float(1.0E-5)
1062  [19]=>
1063  float(-1.0E-5)
1064  [20]=>
1065  float(100000)
1066  [21]=>
1067  float(-100000)
1068  [22]=>
1069  float(100000)
1070  [23]=>
1071  float(-100000)
1072  [24]=>
1073  float(100000)
1074  [25]=>
1075  float(-100000)
1076  [26]=>
1077  float(1.0E-5)
1078  [27]=>
1079  float(-1.0E-5)
1080  [28]=>
1081  float(-2147483649)
1082  [29]=>
1083  float(2147483649)
1084  [30]=>
1085  float(2147483649)
1086  [31]=>
1087  float(-2147483649)
1088}
1089array(14) {
1090  [0]=>
1091  string(0) ""
1092  [1]=>
1093  string(0) ""
1094  [2]=>
1095  string(1) " "
1096  [3]=>
1097  string(1) " "
1098  [4]=>
1099  string(1) "0"
1100  [5]=>
1101  string(1) "�"
1102  [6]=>
1103  string(2) "\0"
1104  [7]=>
1105  string(1) "	"
1106  [8]=>
1107  string(2) "\t"
1108  [9]=>
1109  string(3) "PHP"
1110  [10]=>
1111  string(3) "PHP"
1112  [11]=>
1113  string(29) "abcd�n1234�05678�00efgh\xijkl"
1114  [12]=>
1115  string(34) "abcd�efgh�ijkl�mnop�0qrst�uvwx�0yz"
1116  [13]=>
1117  string(22) "1234
11185678
1119	9100
1119abcda"
1120}
1121array(15) {
1122  [0]=>
1123  array(0) {
1124  }
1125  [1]=>
1126  array(1) {
1127    [0]=>
1128    NULL
1129  }
1130  [2]=>
1131  array(1) {
1132    [0]=>
1133    NULL
1134  }
1135  [3]=>
1136  array(1) {
1137    [0]=>
1138    bool(true)
1139  }
1140  [4]=>
1141  array(1) {
1142    [0]=>
1143    string(0) ""
1144  }
1145  [5]=>
1146  array(1) {
1147    [0]=>
1148    string(0) ""
1149  }
1150  [6]=>
1151  array(2) {
1152    [0]=>
1153    array(0) {
1154    }
1155    [1]=>
1156    array(0) {
1157    }
1158  }
1159  [7]=>
1160  array(2) {
1161    [0]=>
1162    array(2) {
1163      [0]=>
1164      int(1)
1165      [1]=>
1166      int(2)
1167    }
1168    [1]=>
1169    array(2) {
1170      [0]=>
1171      string(1) "a"
1172      [1]=>
1173      string(1) "b"
1174    }
1175  }
1176  [8]=>
1177  array(1) {
1178    [1]=>
1179    string(3) "One"
1180  }
1181  [9]=>
1182  array(1) {
1183    ["test"]=>
1184    string(8) "is_array"
1185  }
1186  [10]=>
1187  array(1) {
1188    [0]=>
1189    int(0)
1190  }
1191  [11]=>
1192  array(1) {
1193    [0]=>
1194    int(-1)
1195  }
1196  [12]=>
1197  array(2) {
1198    [0]=>
1199    float(10.5)
1200    [1]=>
1201    float(5.6)
1202  }
1203  [13]=>
1204  array(2) {
1205    [0]=>
1206    string(6) "string"
1207    [1]=>
1208    string(4) "test"
1209  }
1210  [14]=>
1211  array(2) {
1212    [0]=>
1213    string(6) "string"
1214    [1]=>
1215    string(4) "test"
1216  }
1217}
1218array(4) {
1219  [0]=>
1220  bool(true)
1221  [1]=>
1222  bool(false)
1223  [2]=>
1224  bool(true)
1225  [3]=>
1226  bool(false)
1227}
1228array(2) {
1229  [0]=>
1230  resource(%d) of type (stream)
1231  [1]=>
1232  resource(%d) of type (stream)
1233}
1234array(9) {
1235  [0]=>
1236  object(object_class)#6 (7) {
1237    ["value"]=>
1238    int(50)
1239    ["public_var1"]=>
1240    int(10)
1241    ["private_var1":"object_class":private]=>
1242    int(20)
1243    ["private_var2":"object_class":private]=>
1244    int(21)
1245    ["protected_var1":protected]=>
1246    string(8) "string_1"
1247    ["protected_var2":protected]=>
1248    string(8) "string_2"
1249    ["public_var2"]=>
1250    int(11)
1251  }
1252  [1]=>
1253  object(no_member_class)#7 (0) {
1254  }
1255  [2]=>
1256  object(contains_object_class)#8 (7) {
1257    ["p"]=>
1258    int(30)
1259    ["class_object1"]=>
1260    object(object_class)#9 (7) {
1261      ["value"]=>
1262      int(50)
1263      ["public_var1"]=>
1264      int(10)
1265      ["private_var1":"object_class":private]=>
1266      int(20)
1267      ["private_var2":"object_class":private]=>
1268      int(21)
1269      ["protected_var1":protected]=>
1270      string(8) "string_1"
1271      ["protected_var2":protected]=>
1272      string(8) "string_2"
1273      ["public_var2"]=>
1274      int(11)
1275    }
1276    ["class_object2"]=>
1277    object(object_class)#10 (7) {
1278      ["value"]=>
1279      int(50)
1280      ["public_var1"]=>
1281      int(10)
1282      ["private_var1":"object_class":private]=>
1283      int(20)
1284      ["private_var2":"object_class":private]=>
1285      int(21)
1286      ["protected_var1":protected]=>
1287      string(8) "string_1"
1288      ["protected_var2":protected]=>
1289      string(8) "string_2"
1290      ["public_var2"]=>
1291      int(11)
1292    }
1293    ["class_object3":"contains_object_class":private]=>
1294    object(object_class)#9 (7) {
1295      ["value"]=>
1296      int(50)
1297      ["public_var1"]=>
1298      int(10)
1299      ["private_var1":"object_class":private]=>
1300      int(20)
1301      ["private_var2":"object_class":private]=>
1302      int(21)
1303      ["protected_var1":protected]=>
1304      string(8) "string_1"
1305      ["protected_var2":protected]=>
1306      string(8) "string_2"
1307      ["public_var2"]=>
1308      int(11)
1309    }
1310    ["class_object4":protected]=>
1311    object(object_class)#10 (7) {
1312      ["value"]=>
1313      int(50)
1314      ["public_var1"]=>
1315      int(10)
1316      ["private_var1":"object_class":private]=>
1317      int(20)
1318      ["private_var2":"object_class":private]=>
1319      int(21)
1320      ["protected_var1":protected]=>
1321      string(8) "string_1"
1322      ["protected_var2":protected]=>
1323      string(8) "string_2"
1324      ["public_var2"]=>
1325      int(11)
1326    }
1327    ["no_member_class_object"]=>
1328    object(no_member_class)#11 (0) {
1329    }
1330    ["class_object5"]=>
1331    *RECURSION*
1332  }
1333  [3]=>
1334  object(contains_object_class)#1 (7) {
1335    ["p"]=>
1336    int(30)
1337    ["class_object1"]=>
1338    object(object_class)#2 (7) {
1339      ["value"]=>
1340      int(50)
1341      ["public_var1"]=>
1342      int(10)
1343      ["private_var1":"object_class":private]=>
1344      int(20)
1345      ["private_var2":"object_class":private]=>
1346      int(21)
1347      ["protected_var1":protected]=>
1348      string(8) "string_1"
1349      ["protected_var2":protected]=>
1350      string(8) "string_2"
1351      ["public_var2"]=>
1352      int(11)
1353    }
1354    ["class_object2"]=>
1355    object(object_class)#3 (7) {
1356      ["value"]=>
1357      int(50)
1358      ["public_var1"]=>
1359      int(10)
1360      ["private_var1":"object_class":private]=>
1361      int(20)
1362      ["private_var2":"object_class":private]=>
1363      int(21)
1364      ["protected_var1":protected]=>
1365      string(8) "string_1"
1366      ["protected_var2":protected]=>
1367      string(8) "string_2"
1368      ["public_var2"]=>
1369      int(11)
1370    }
1371    ["class_object3":"contains_object_class":private]=>
1372    object(object_class)#2 (7) {
1373      ["value"]=>
1374      int(50)
1375      ["public_var1"]=>
1376      int(10)
1377      ["private_var1":"object_class":private]=>
1378      int(20)
1379      ["private_var2":"object_class":private]=>
1380      int(21)
1381      ["protected_var1":protected]=>
1382      string(8) "string_1"
1383      ["protected_var2":protected]=>
1384      string(8) "string_2"
1385      ["public_var2"]=>
1386      int(11)
1387    }
1388    ["class_object4":protected]=>
1389    object(object_class)#3 (7) {
1390      ["value"]=>
1391      int(50)
1392      ["public_var1"]=>
1393      int(10)
1394      ["private_var1":"object_class":private]=>
1395      int(20)
1396      ["private_var2":"object_class":private]=>
1397      int(21)
1398      ["protected_var1":protected]=>
1399      string(8) "string_1"
1400      ["protected_var2":protected]=>
1401      string(8) "string_2"
1402      ["public_var2"]=>
1403      int(11)
1404    }
1405    ["no_member_class_object"]=>
1406    object(no_member_class)#4 (0) {
1407    }
1408    ["class_object5"]=>
1409    *RECURSION*
1410  }
1411  [4]=>
1412  object(object_class)#2 (7) {
1413    ["value"]=>
1414    int(50)
1415    ["public_var1"]=>
1416    int(10)
1417    ["private_var1":"object_class":private]=>
1418    int(20)
1419    ["private_var2":"object_class":private]=>
1420    int(21)
1421    ["protected_var1":protected]=>
1422    string(8) "string_1"
1423    ["protected_var2":protected]=>
1424    string(8) "string_2"
1425    ["public_var2"]=>
1426    int(11)
1427  }
1428  [5]=>
1429  object(object_class)#3 (7) {
1430    ["value"]=>
1431    int(50)
1432    ["public_var1"]=>
1433    int(10)
1434    ["private_var1":"object_class":private]=>
1435    int(20)
1436    ["private_var2":"object_class":private]=>
1437    int(21)
1438    ["protected_var1":protected]=>
1439    string(8) "string_1"
1440    ["protected_var2":protected]=>
1441    string(8) "string_2"
1442    ["public_var2"]=>
1443    int(11)
1444  }
1445  [6]=>
1446  object(no_member_class)#4 (0) {
1447  }
1448  [7]=>
1449  object(object_class)#5 (7) {
1450    ["value"]=>
1451    int(50)
1452    ["public_var1"]=>
1453    int(10)
1454    ["private_var1":"object_class":private]=>
1455    int(20)
1456    ["private_var2":"object_class":private]=>
1457    int(21)
1458    ["protected_var1":protected]=>
1459    string(8) "string_1"
1460    ["protected_var2":protected]=>
1461    string(8) "string_2"
1462    ["public_var2"]=>
1463    int(11)
1464  }
1465  [8]=>
1466  NULL
1467}
1468array(4) {
1469  [0]=>
1470  NULL
1471  [1]=>
1472  NULL
1473  [2]=>
1474  NULL
1475  [3]=>
1476  NULL
1477}
1478array(6) {
1479  [0]=>
1480  array(3) {
1481    [0]=>
1482    int(123)
1483    [1]=>
1484    float(-1.2345)
1485    [2]=>
1486    string(1) "a"
1487  }
1488  [1]=>
1489  array(4) {
1490    [0]=>
1491    string(1) "d"
1492    [1]=>
1493    array(3) {
1494      [0]=>
1495      int(1)
1496      [1]=>
1497      int(3)
1498      [2]=>
1499      int(5)
1500    }
1501    [2]=>
1502    bool(true)
1503    [3]=>
1504    NULL
1505  }
1506  [2]=>
1507  array(4) {
1508    [0]=>
1509    object(no_member_class)#14 (0) {
1510    }
1511    [1]=>
1512    array(0) {
1513    }
1514    [2]=>
1515    bool(false)
1516    [3]=>
1517    int(0)
1518  }
1519  [3]=>
1520  array(6) {
1521    [0]=>
1522    float(0)
1523    [1]=>
1524    string(11) "Where am I?"
1525    [2]=>
1526    array(3) {
1527      [0]=>
1528      int(7)
1529      [1]=>
1530      int(8)
1531      [2]=>
1532      int(9)
1533    }
1534    [3]=>
1535    bool(true)
1536    [4]=>
1537    string(1) "A"
1538    [5]=>
1539    int(987654321)
1540  }
1541  [4]=>
1542  array(4) {
1543    [0]=>
1544    NULL
1545    [1]=>
1546    float(20000000000)
1547    [2]=>
1548    float(79.1)
1549    [3]=>
1550    float(4.599998)
1551  }
1552  [5]=>
1553  array(4) {
1554    [0]=>
1555    string(27) "array(1,2,3,4)1.0000002TRUE"
1556    [1]=>
1557    NULL
1558    [2]=>
1559    float(4611333)
1560    [3]=>
1561    string(5) "/00\7"
1562  }
1563}
1564
1565*** Testing var_dump() on anonymous functions ***
1566New anonymous function: �lambda_1
1567string(9) "2 * 3 = 6"
1568string(9) "�lambda_2"
1569
1570*** Testing error conditions ***
1571
1572Warning: var_dump() expects at least 1 parameter, 0 given in %s on line %d
1573Done
1574
1575