1--TEST--
2Test property_exists() function : error conditions
3--FILE--
4<?php
5/* Prototype  : bool property_exists(mixed object_or_class, string property_name)
6 * Description: Checks if the object or class has a property
7 * Source code: Zend/zend_builtin_functions.c
8 * Alias to functions:
9 */
10
11echo "*** Testing property_exists() : error conditions ***\n";
12
13$object_or_class = "obj";
14$property_name = 'string_val';
15$extra_arg = 10;
16
17
18echo "\n-- Testing property_exists() function with more than expected no. of arguments --\n";
19var_dump( property_exists($object_or_class, $property_name, $extra_arg) );
20
21
22echo "\n-- Testing property_exists() function with less than expected no. of arguments --\n";
23var_dump( property_exists($object_or_class) );
24
25echo "\n-- Testing property_exists() function with incorrect arguments --\n";
26var_dump( property_exists(10, $property_name) );
27
28?>
29===DONE===
30--EXPECTF--
31*** Testing property_exists() : error conditions ***
32
33-- Testing property_exists() function with more than expected no. of arguments --
34
35Warning: property_exists() expects exactly 2 parameters, 3 given in %sproperty_exists_error.php on line %d
36NULL
37
38-- Testing property_exists() function with less than expected no. of arguments --
39
40Warning: property_exists() expects exactly 2 parameters, 1 given in %sproperty_exists_error.php on line %d
41NULL
42
43-- Testing property_exists() function with incorrect arguments --
44
45Warning: First parameter must either be an object or the name of an existing class in %sproperty_exists_error.php on line %d
46NULL
47===DONE===
48