3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = new stdClass; function a() { global $s; return $s; } a()->b = 'a'; echo a()->b;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2sAY
function name:  (null)
number of ops:  13
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   11     3        INIT_FCALL                                               'a'
          4        DO_FCALL                                      0  $4      
          5        SEPARATE                                         $4      $4
          6        ASSIGN_OBJ                                               $4, 'b'
          7        OP_DATA                                                  'a'
   13     8        INIT_FCALL                                               'a'
          9        DO_FCALL                                      0  $6      
         10        FETCH_OBJ_R                                      ~7      $6, 'b'
         11        ECHO                                                     ~7
         12      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2sAY
function name:  a
number of ops:  3
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   BIND_GLOBAL                                              !0, 's'
    8     1      > RETURN                                                   !0
    9     2*     > RETURN                                                   null

End of function a

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.73 ms | 1389 KiB | 15 Q