3v4l.org

run code in 300+ PHP versions simultaneously
<?php function staticSurprise() { static $v = 'Before'; echo $v; return false; static $v = 'After'; static $v = 'After2'; } staticSurprise(); static $v = 'After';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BAfMX
function name:  (null)
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'staticsurprise'
          1        DO_FCALL                                      0          
   15     2        BIND_STATIC                                              !0
          3      > RETURN                                                   1

Function staticsurprise:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BAfMX
function name:  staticSurprise
number of ops:  6
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        ECHO                                                     !0
    7     2      > RETURN                                                   <false>
    8     3*       BIND_STATIC                                              !0
    9     4*       BIND_STATIC                                              !0
   12     5*     > RETURN                                                   null

End of function staticsurprise

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1396 KiB | 14 Q