summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bin2hex_error.phpt
blob: 9d2e1313a1e26ae6d6b982321a0419de5f4c91b1 (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
35
--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===