--- /dev/null
+--TEST--
+Test function get_cfg_var() by substituting argument 1 with array values.
+--CREDITS--
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--INI--
+session.use_cookies=0
+session.serialize_handler=php
+session.save_handler=files
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 1 with array values ***\n";
+
+
+
+$index_array = array(1, 2, 3);
+$assoc_array = array(1 => 'one', 2 => 'two');
+
+$variation_array = array(
+ 'empty array' => array(),
+ 'int indexed array' => $index_array,
+ 'associative array' => $assoc_array,
+ 'nested arrays' => array('foo', $index_array, $assoc_array),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(get_cfg_var( $var ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 1 with array values ***
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
--- /dev/null
+--TEST--
+Test function get_cfg_var() by substituting argument 1 with object values.
+--CREDITS--
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--INI--
+session.use_cookies=0
+session.serialize_handler=php
+session.save_handler=files
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 1 with object values ***\n";
+
+class classWithToString
+{
+ public function __toString() {
+ return "session.use_cookies";
+ }
+}
+
+class classWithoutToString
+{
+}
+
+$variation_array = array(
+ 'instance of classWithToString' => new classWithToString(),
+ 'instance of classWithoutToString' => new classWithoutToString(),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(get_cfg_var( $var ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 1 with object values ***
+string(1) "0"
+
+Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d
--- /dev/null
+--TEST--
+Test function get_cfg_var() by calling deprecated option
+--CREDITS--
+Francesco Fullone ff@ideato.it
+#PHPTestFest Cesena Italia on 2009-06-20
+--INI--
+register_globals=1
+--SKIPIF--
+<?php if (version_compare(PHP_VERSION, "5.3", "<")) die("skip requires 5.3 or greater"); ?>
+--FILE--
+<?php
+echo "*** Test by calling method or function with deprecated option ***\n";
+var_dump(get_cfg_var( 'register_globals' ) );
+
+?>
+--EXPECTF--
+PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in %s on line 0
+*** Test by calling method or function with deprecated option ***
+string(1) "1"
+
--- /dev/null
+--TEST--
+Test function getservbyname() by substituting argument 1 with array values.
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 1 with array values ***\n";
+
+$protocol = "tcp";
+
+
+$index_array = array(1, 2, 3);
+$assoc_array = array(1 => 'one', 2 => 'two');
+
+$variation_array = array(
+ 'empty array' => array(),
+ 'int indexed array' => $index_array,
+ 'associative array' => $assoc_array,
+ 'nested arrays' => array('foo', $index_array, $assoc_array),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(getservbyname( $var , $protocol ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 1 with array values ***
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
--- /dev/null
+--TEST--
+Test function getservbyname() by substituting argument 2 with object values.
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 2 with object values ***\n";
+
+$service = "www";
+
+
+class classWithToString
+{
+ public function __toString() {
+ return "Class A object";
+ }
+}
+
+class classWithoutToString
+{
+}
+
+$variation_array = array(
+ 'instance of classWithToString' => new classWithToString(),
+ 'instance of classWithoutToString' => new classWithoutToString(),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(getservbyname( $service, $var ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 2 with object values ***
+bool(false)
+
+Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d
--- /dev/null
+--TEST--
+Test function getservbyname() by substituting argument 1 with object values.
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 1 with object values ***\n";
+
+$protocol = "tcp";
+
+
+class classWithToString
+{
+ public function __toString() {
+ return "Class A object";
+ }
+}
+
+class classWithoutToString
+{
+}
+
+$variation_array = array(
+ 'instance of classWithToString' => new classWithToString(),
+ 'instance of classWithoutToString' => new classWithoutToString(),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(getservbyname( $var , $protocol ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 1 with object values ***
+bool(false)
+
+Catchable fatal error: Object of class classWithoutToString could not be converted to string in %s.php on line %d
--- /dev/null
+--TEST--
+Test function getservbyname() by substituting argument 2 with array values.
+--FILE--
+<?php
+
+
+echo "*** Test substituting argument 2 with array values ***\n";
+
+$service = "www";
+
+
+$index_array = array(1, 2, 3);
+$assoc_array = array(1 => 'one', 2 => 'two');
+
+$variation_array = array(
+ 'empty array' => array(),
+ 'int indexed array' => $index_array,
+ 'associative array' => $assoc_array,
+ 'nested arrays' => array('foo', $index_array, $assoc_array),
+ );
+
+
+foreach ( $variation_array as $var ) {
+ var_dump(getservbyname( $service, $var ) );
+}
+?>
+--EXPECTF--
+*** Test substituting argument 2 with array values ***
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)
+
+Notice: Array to string conversion in %s.php on line %d
+bool(false)