3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a () { static $b = null; if (is_null($b)) { echo 'Doing work.'; $b = 'blop'; } return $b; } var_dump(a()); var_dump(a()); var_dump(a()); var_dump(a()); var_dump(a()); var_dump(a()); var_dump(a()); var_dump(a());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WiP0N
function name:  (null)
number of ops:  41
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'a'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   12     5        INIT_FCALL                                               'var_dump'
          6        INIT_FCALL                                               'a'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   13    10        INIT_FCALL                                               'var_dump'
         11        INIT_FCALL                                               'a'
         12        DO_FCALL                                      0  $4      
         13        SEND_VAR                                                 $4
         14        DO_ICALL                                                 
   14    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'a'
         17        DO_FCALL                                      0  $6      
         18        SEND_VAR                                                 $6
         19        DO_ICALL                                                 
   15    20        INIT_FCALL                                               'var_dump'
         21        INIT_FCALL                                               'a'
         22        DO_FCALL                                      0  $8      
         23        SEND_VAR                                                 $8
         24        DO_ICALL                                                 
   16    25        INIT_FCALL                                               'var_dump'
         26        INIT_FCALL                                               'a'
         27        DO_FCALL                                      0  $10     
         28        SEND_VAR                                                 $10
         29        DO_ICALL                                                 
   17    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'a'
         32        DO_FCALL                                      0  $12     
         33        SEND_VAR                                                 $12
         34        DO_ICALL                                                 
   18    35        INIT_FCALL                                               'var_dump'
         36        INIT_FCALL                                               'a'
         37        DO_FCALL                                      0  $14     
         38        SEND_VAR                                                 $14
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/WiP0N
function name:  a
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   BIND_STATIC                                              !0
    4     1        TYPE_CHECK                                    2          !0
          2      > JMPZ                                                     ~1, ->5
    5     3    >   ECHO                                                     'Doing+work.'
    6     4        ASSIGN                                                   !0, 'blop'
    8     5    > > RETURN                                                   !0
    9     6*     > RETURN                                                   null

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.6 ms | 1394 KiB | 23 Q