3v4l.org

run code in 300+ PHP versions simultaneously
<?php global $arrTest; function getArrTest() { global $arrTest; $arrTest = array('test' => 'hello'); if (!isset($arrTest['test2'])) { return $arrTest['test2'] = 1; } } var_dump($arrTest); var_dump(getArrTest());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OgSo4
function name:  (null)
number of ops:  10
compiled vars:  !0 = $arrTest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   BIND_GLOBAL                                              !0, 'arrTest'
   13     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   14     4        INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'getarrtest'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function getarrtest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OgSo4
function name:  getArrTest
number of ops:  9
compiled vars:  !0 = $arrTest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   BIND_GLOBAL                                              !0, 'arrTest'
    5     1        ASSIGN                                                   !0, <array>
    7     2        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      !0, 'test2'
          3        BOOL_NOT                                         ~3      ~2
          4      > JMPZ                                                     ~3, ->8
    8     5    >   ASSIGN_DIM                                       ~4      !0, 'test2'
          6        OP_DATA                                                  1
          7      > RETURN                                                   ~4
   11     8    > > RETURN                                                   null

End of function getarrtest

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.77 ms | 1398 KiB | 16 Q