what could be wrong with this php syntax

Viewed 19

whats whrong with this php syntax code:

@trigger_error(sprintf("Using '%s' for the value of node '%s' of '%s' is deprecated since version 1.25 and will be removed in 2.0.", is_object($node) ? get_class($node) : null === $node "null": gettype($node), $name, get_class($this)), E_USER_DEPRECATED);
1 Answers

you are missing "?" after $node and nested ternary expressions are deprecated since PHP 7.4, so wrap it with "( ... )"

here full code:

@trigger_error(
    sprintf(
        "Using '%s' for the value of node '%s' of '%s' is deprecated since version 1.25 and will be removed in 2.0.",
        ((is_object($node) ? get_class($node) : null === $node) ? "null" : gettype($node)), $name, get_class($this)), 
    E_USER_DEPRECATED
);
Related