3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a () { static $ax = 0; function b() { static $bx = 0; echo "I am ".__FUNCTION__.". I have been called ".$bx++." times\n"; } echo "I am ".__FUNCTION__.". I have been called ".$ax++." times\n"; } echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n"; b(); a(); echo function_exists("b") ? "b is defined\n" : "b is not defined\n";

preferences:
50.28 ms | 402 KiB | 5 Q