3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a () { static $a = 0; function b() { static $b = 0; echo "I am ".__FUNCTION__.". I have been called ".$b++." times\n"; } echo "I am ".__FUNCTION__.". I have been called ".$a++." 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";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
Branch analysis from position: 28
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
Branch analysis from position: 16
filename:       /in/oODqT
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'function_exists'
          1        SEND_VAL                                                 'b'
          2        DO_ICALL                                         $0      
          3      > JMPZ                                                     $0, ->6
          4    >   QM_ASSIGN                                        ~1      'b+is+defined%0A'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~1      'b+is+not+defined%0A'
          7    >   ECHO                                                     ~1
   13     8        INIT_FCALL                                               'a'
          9        DO_FCALL                                      0          
   14    10        INIT_FCALL                                               'function_exists'
         11        SEND_VAL                                                 'b'
         12        DO_ICALL                                         $3      
         13      > JMPZ                                                     $3, ->16
         14    >   QM_ASSIGN                                        ~4      'b+is+defined%0A'
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~4      'b+is+not+defined%0A'
         17    >   ECHO                                                     ~4
   15    18        INIT_FCALL_BY_NAME                                       'b'
         19        DO_FCALL                                      0          
   17    20        INIT_FCALL                                               'a'
         21        DO_FCALL                                      0          
   18    22        INIT_FCALL                                               'function_exists'
         23        SEND_VAL                                                 'b'
         24        DO_ICALL                                         $7      
         25      > JMPZ                                                     $7, ->28
         26    >   QM_ASSIGN                                        ~8      'b+is+defined%0A'
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~8      'b+is+not+defined%0A'
         29    >   ECHO                                                     ~8
         30      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oODqT
function name:  a
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        DECLARE_FUNCTION                                         'b'
    9     2        POST_INC                                         ~1      !0
          3        CONCAT                                           ~2      'I+am+a.+I+have+been+called+', ~1
          4        CONCAT                                           ~3      ~2, '+times%0A'
          5        ECHO                                                     ~3
   10     6      > RETURN                                                   null

End of function a

Function %00b%2Fin%2FoODqT%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oODqT
function name:  b
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_STATIC                                              !0
    7     1        POST_INC                                         ~1      !0
          2        CONCAT                                           ~2      'I+am+b.+I+have+been+called+', ~1
          3        CONCAT                                           ~3      ~2, '+times%0A'
          4        ECHO                                                     ~3
    8     5      > RETURN                                                   null

End of function %00b%2Fin%2FoODqT%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.11 ms | 1403 KiB | 17 Q