mirror of
https://github.com/php/php-src.git
synced 2024-12-16 21:37:49 +08:00
b5c7a83dca
Closes GH-5759
37 lines
795 B
PHP
37 lines
795 B
PHP
--TEST--
|
|
function_exists function : basic functionality
|
|
--FILE--
|
|
<?php
|
|
/*
|
|
* 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'));
|
|
?>
|
|
--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)
|