3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = doThing(); #$arr = createArray('id', "a"); echo $arr['jiraId']; #echo $arr['casinoCode']; #echo $arr['whatever']; function createArray($jiraId = null, $casinoCode = null) : array { if ($casinoCode){ echo "CASINO"; } return array('jiraId' => $jiraId, 'casinoCode' => $casinoCode); } function doThing($feature){ return createArray($feature); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vbagm
function name:  (null)
number of ops:  6
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'doThing'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
    5     3        FETCH_DIM_R                                      ~3      !0, 'jiraId'
          4        ECHO                                                     ~3
   18     5      > RETURN                                                   1

Function createarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/vbagm
function name:  createArray
number of ops:  10
compiled vars:  !0 = $jiraId, !1 = $casinoCode
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
   10     2      > JMPZ                                                     !1, ->4
   11     3    >   ECHO                                                     'CASINO'
   13     4    >   INIT_ARRAY                                       ~2      !0, 'jiraId'
          5        ADD_ARRAY_ELEMENT                                ~2      !1, 'casinoCode'
          6        VERIFY_RETURN_TYPE                                       ~2
          7      > RETURN                                                   ~2
   14     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function createarray

Function dothing:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vbagm
function name:  doThing
number of ops:  6
compiled vars:  !0 = $feature
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   17     1        INIT_FCALL                                               'createarray'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   18     5*     > RETURN                                                   null

End of function dothing

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.79 ms | 944 KiB | 15 Q