1--TEST--
2Test array_pad() function : usage variations - binary safe checking
3--FILE--
4<?php
5/*
6* Passing binary values to $pad_value argument and testing whether
7* array_pad() behaves in an expected way with the other arguments passed to the function.
8* The $input and $pad_size arguments passed are fixed values.
9*/
10
11echo "*** Testing array_pad() : Passing binary values to \$pad_value argument ***\n";
12
13// initialize the $input and $pad_size argument
14$input = array(1, 2, 3);
15$pad_size = 6;
16
17// initialize $pad_value with reference variable
18$binary = b"hello";
19
20var_dump( array_pad($input, $pad_size, $binary) );  // positive 'pad_size'
21var_dump( array_pad($input, -$pad_size, $binary) );  // negative 'pad_size'
22
23echo "Done";
24?>
25--EXPECT--
26*** Testing array_pad() : Passing binary values to $pad_value argument ***
27array(6) {
28  [0]=>
29  int(1)
30  [1]=>
31  int(2)
32  [2]=>
33  int(3)
34  [3]=>
35  string(5) "hello"
36  [4]=>
37  string(5) "hello"
38  [5]=>
39  string(5) "hello"
40}
41array(6) {
42  [0]=>
43  string(5) "hello"
44  [1]=>
45  string(5) "hello"
46  [2]=>
47  string(5) "hello"
48  [3]=>
49  int(1)
50  [4]=>
51  int(2)
52  [5]=>
53  int(3)
54}
55Done
56