~ubuntu-branches/ubuntu/quantal/php5/quantal

« back to all changes in this revision

Viewing changes to ext/standard/tests/general_functions/is_callable_error.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Sean Finney
  • Date: 2009-07-01 09:12:10 UTC
  • mto: (0.9.1) (1.1.17 upstream)
  • mto: This revision was merged to the branch mainline in revision 58.
  • Revision ID: james.westby@ubuntu.com-20090701091210-go0h6506p62on17r
Tags: upstream-5.3.0
ImportĀ upstreamĀ versionĀ 5.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
Test is_callable() function
 
3
--INI--
 
4
precision=14
 
5
error_reporting = E_ALL & ~E_NOTICE | E_STRICT
 
6
--FILE--
 
7
<?php
 
8
/* Prototype: bool is_callable ( mixed $var [, bool $syntax_only [, string &$callable_name]] );
 
9
   Description: Verify that the contents of a variable can be called as a function
 
10
                In case of objects, $var = array($SomeObject, 'MethodName')
 
11
*/
 
12
 
 
13
echo "\n*** Testing error conditions ***\n";
 
14
 
 
15
echo "\n-- Testing is_callable() function with less than expected no. of arguments --\n";
 
16
var_dump( is_callable() );
 
17
 
 
18
echo "\n-- Testing is_callable() function with more than expected no. of arguments --\n";
 
19
var_dump( is_callable("string", TRUE, $callable_name, "EXTRA") );
 
20
 
 
21
?>
 
22
===DONE===
 
23
--EXPECTF--
 
24
*** Testing error conditions ***
 
25
 
 
26
-- Testing is_callable() function with less than expected no. of arguments --
 
27
 
 
28
Warning: is_callable() expects at least 1 parameter, 0 given in %s on line %d
 
29
NULL
 
30
 
 
31
-- Testing is_callable() function with more than expected no. of arguments --
 
32
 
 
33
Warning: is_callable() expects at most 3 parameters, 4 given in %s on line %d
 
34
NULL
 
35
===DONE===
 
 
b'\\ No newline at end of file'