PHP 8.4.6 Released!

ReflectionFunctionAbstract::getStaticVariables

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

ReflectionFunctionAbstract::getStaticVariablesDuruk değişkenleri döndürür

Açıklama

public ReflectionFunctionAbstract::getStaticVariables(): array

Duruk değişkenleri döndürür.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Duruk değişken dizisi.

Ayrıca Bakınız

add a note

User Contributed Notes 1 note

up
5
Martiros Aghajanyan
10 years ago
<?php

function test()
{
static
$a = 0, $b = 15;
$a++;
$b++;
return
$a;
}

$rf = new ReflectionFunction('test');

/ result - Array ( [a] => 0 [b] => 15 )
print_r( $rf->getStaticVariables() );

/call test function and print again static variables
test();

/ result - Array ( [a] => 1 [b] => 16 )
print_r( $rf->getStaticVariables() );

?>
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant