PHP Velho Oeste 2024

parsekit_func_arginfo

(PECL parsekit >= 0.3.0)

parsekit_func_arginfoRetourne des informations concernant les arguments d'une fonction

Description

parsekit_func_arginfo ( mixed $function ) : array
Avertissement

Cette fonction est EXPERIMENTALE. Le comportement de cette fonction, son nom, et toute la documentation autour de cette fonction peut changer sans préavis dans une prochaine version de PHP. Cette fonction doit être utilisée à vos risques et périls.

Liste de paramètres

function

Une chaîne décrivant une fonction ou un tableau décrivant une classe/méthode.

Valeurs de retour

Retourne un tableau contenant les informations sur les arguments.

Exemples

Exemple #1 Exemple avec parsekit_func_arginfo()

<?php
function foo($barstdClass $baz, &$bomb$bling false) {
}

var_dump(parsekit_func_arginfo('foo'));
?>

L'exemple ci-dessus va afficher :

array(4) {
  [0]=>
  array(3) {
    ["name"]=>
    string(3) "bar"
    ["allow_null"]=>
    bool(true)
    ["pass_by_reference"]=>
    bool(false)
  }
  [1]=>
  array(4) {
    ["name"]=>
    string(3) "baz"
    ["class_name"]=>
    string(8) "stdClass"
    ["allow_null"]=>
    bool(false)
    ["pass_by_reference"]=>
    bool(false)
  }
  [2]=>
  array(3) {
    ["name"]=>
    string(4) "bomb"
    ["allow_null"]=>
    bool(true)
    ["pass_by_reference"]=>
    bool(true)
  }
  [3]=>
  array(3) {
    ["name"]=>
    string(5) "bling"
    ["allow_null"]=>
    bool(true)
    ["pass_by_reference"]=>
    bool(false)
  }
}

add a note add a note

User Contributed Notes 1 note

up
0
fantasysportswire at yahoo dot com
17 years ago
Should be noted that this is for user defined functions only.  Not internal (extension or otherwise).
To Top