3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getv() { static $v = 4; return $v++; } define('V', getv()); echo V . PHP_EOL; echo getv() . PHP_EOL; echo V . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JYVg2
function name:  (null)
number of ops:  17
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'V'
          2        INIT_FCALL                                               'getv'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    9     6        FETCH_CONSTANT                                   ~2      'V'
          7        CONCAT                                           ~3      ~2, '%0A'
          8        ECHO                                                     ~3
   10     9        INIT_FCALL                                               'getv'
         10        DO_FCALL                                      0  $4      
         11        CONCAT                                           ~5      $4, '%0A'
         12        ECHO                                                     ~5
   11    13        FETCH_CONSTANT                                   ~6      'V'
         14        CONCAT                                           ~7      ~6, '%0A'
         15        ECHO                                                     ~7
   12    16      > RETURN                                                   1

Function getv:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JYVg2
function name:  getv
number of ops:  4
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_STATIC                                              !0
    5     1        POST_INC                                         ~1      !0
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function getv

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.35 ms | 1012 KiB | 16 Q