Browse Source

The is_null() is useless now, as it always returns FALSE.

pull/50/head
Rafal Kupiec 2 years ago
parent
commit
9d7a542aea
Signed by: belliash GPG Key ID: 4E829243E0CFE6B4
2 changed files with 1 additions and 19 deletions
  1. +0
    -18
      engine/builtin.c
  2. +1
    -1
      engine/vm.c

+ 0
- 18
engine/builtin.c View File

@ -94,23 +94,6 @@ static int PH7_builtin_is_string(ph7_context *pCtx, int nArg, ph7_value **apArg)
ph7_result_bool(pCtx, res);
return PH7_OK;
}
/*
* bool is_null($var)
* Finds out whether a variable is NULL.
* Parameters
* $var: The variable being evaluated.
* Return
* TRUE if var is NULL. False otherwise.
*/
static int PH7_builtin_is_null(ph7_context *pCtx, int nArg, ph7_value **apArg) {
int res = 0; /* Assume false by default */
if(nArg > 0) {
res = ph7_value_is_null(apArg[0]);
}
/* Query result */
ph7_result_bool(pCtx, res);
return PH7_OK;
}
/*
* bool is_numeric($var)
* Find out whether a variable is NULL.
@ -7471,7 +7454,6 @@ static const ph7_builtin_func aBuiltInFunc[] = {
{ "is_float", PH7_builtin_is_float },
{ "is_int", PH7_builtin_is_int },
{ "is_string", PH7_builtin_is_string },
{ "is_null", PH7_builtin_is_null },
{ "is_numeric", PH7_builtin_is_numeric },
{ "is_scalar", PH7_builtin_is_scalar },
{ "is_array", PH7_builtin_is_array },


+ 1
- 1
engine/vm.c View File

@ -1120,7 +1120,7 @@ PH7_PRIVATE sxi32 PH7_VmMakeReady(
}
/* Register built-in constants [i.e: PHP_EOL, PHP_OS...] */
PH7_RegisterBuiltInConstant(&(*pVm));
/* Register built-in functions [i.e: is_null(), array_diff(), strlen(), etc.] */
/* Register built-in functions [i.e: array_diff(), strlen(), etc.] */
PH7_RegisterBuiltInFunction(&(*pVm));
/* Initialize and install static and constants class attributes */
SyHashResetLoopCursor(&pVm->hClass);


Loading…
Cancel
Save