summaryrefslogtreecommitdiff
path: root/Zend/tests/function_exists_basic.phpt
diff options
context:
space:
mode:
authorandy wharmby <wharmby@php.net>2009-06-14 13:49:18 +0000
committerandy wharmby <wharmby@php.net>2009-06-14 13:49:18 +0000
commitfada257def560fdea281a16ce4e2569fd3444f9f (patch)
tree05df615eae04ed377559916ae4cdb4f07948d078 /Zend/tests/function_exists_basic.phpt
parent845595eb7c4e9d7e42e27dbf6ac775049427b492 (diff)
downloadphp-git-fada257def560fdea281a16ce4e2569fd3444f9f.tar.gz
Basic tests for function_exists() and get_defined_functions(). Tested on Windows, Linux and Linux 64 bit.
Diffstat (limited to 'Zend/tests/function_exists_basic.phpt')
-rw-r--r--Zend/tests/function_exists_basic.phpt39
1 files changed, 39 insertions, 0 deletions
diff --git a/Zend/tests/function_exists_basic.phpt b/Zend/tests/function_exists_basic.phpt
new file mode 100644
index 0000000000..469e3d8c9a
--- /dev/null
+++ b/Zend/tests/function_exists_basic.phpt
@@ -0,0 +1,39 @@
+--TEST--
+function_exists function : basic functionality
+--FILE--
+<?php
+/*
+ * proto bool function_exists(string function_name)
+ * Function is implemented in Zend/zend_builtin_functions.c
+*/
+
+echo "*** Testing function_exists() : basic functionality ***\n";
+
+echo "Internal function: ";
+var_dump(function_exists('function_exists'));
+
+echo "User defined function: ";
+function f() {}
+var_dump(function_exists('f'));
+
+echo "Case sensitivity: ";
+var_dump(function_exists('F'));
+
+echo "Non existent function: ";
+var_dump(function_exists('g'));
+
+echo "Method: ";
+Class C {
+ static function f() {}
+}
+var_dump(function_exists('C::f'));
+?>
+===Done===
+--EXPECT--
+*** Testing function_exists() : basic functionality ***
+Internal function: bool(true)
+User defined function: bool(true)
+Case sensitivity: bool(true)
+Non existent function: bool(false)
+Method: bool(false)
+===Done===