summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bin2hex_error.phpt
blob: efee90bdee7263f543de7dfda237e4ea93287241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
Test bin2hex() function : error conditions
--FILE--
<?php

/* Prototype  : string bin2hex  ( string $str  )
 * Description: Convert binary data into hexadecimal representation
 * Source code: ext/standard/string.c
*/

echo "*** Testing bin2hex() : error conditions ***\n";

echo "\n-- Testing bin2hex() function with no arguments --\n";
var_dump( bin2hex() );

echo "\n-- Testing bin2hex() function with more than expected no. of arguments --\n";
$extra_arg = 10;
var_dump( bin2hex("Hello World", $extra_arg) );

?>
===DONE===
--EXPECTF--
*** Testing bin2hex() : error conditions ***

-- Testing bin2hex() function with no arguments --

Warning: bin2hex() expects exactly 1 parameter, 0 given in %s on line %d
NULL

-- Testing bin2hex() function with more than expected no. of arguments --

Warning: bin2hex() expects exactly 1 parameter, 2 given in %s on line %d
NULL
===DONE===