3v4l.org

run code in 300+ PHP versions simultaneously
<?php function STR2VAR($strs){ $a = explode(',',$strs); foreach($a as $key) { global $$key; $$key = 'test'; } } STR2VAR('exam1,exam2,exam3'); echo $exam1;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/soujM
function name:  (null)
number of ops:  5
compiled vars:  !0 = $exam1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'str2var'
          1        SEND_VAL                                                 'exam1%2Cexam2%2Cexam3'
          2        DO_FCALL                                      0          
   12     3        ECHO                                                     !0
          4      > RETURN                                                   1

Function str2var:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 14
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/soujM
function name:  STR2VAR
number of ops:  16
compiled vars:  !0 = $strs, !1 = $a, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
    5     6      > FE_RESET_R                                       $5      !1, ->14
          7    > > FE_FETCH_R                                               $5, !2, ->14
    6     8    >   FETCH_W                      global lock         $6      !2
          9        FETCH_W                      local               $7      !2
         10        ASSIGN_REF                                               $7, $6
    7    11        FETCH_W                      local               $8      !2
         12        ASSIGN                                                   $8, 'test'
    5    13      > JMP                                                      ->7
         14    >   FE_FREE                                                  $5
   10    15      > RETURN                                                   null

End of function str2var

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.38 ms | 943 KiB | 17 Q