3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=[]; function addToArray($arr,$val) { array_push($arr,["order_id"=>$val]); return $arr; } $arr=addToArray($arr,"1234"); $arr=addToArray($arr,"1234"); print_r($arr); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nm3dH
function name:  (null)
number of ops:  15
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    9     1        INIT_FCALL                                               'addtoarray'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '1234'
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   10     6        INIT_FCALL                                               'addtoarray'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '1234'
          9        DO_FCALL                                      0  $4      
         10        ASSIGN                                                   !0, $4
   12    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   13    14      > RETURN                                                   1

Function addtoarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nm3dH
function name:  addToArray
number of ops:  9
compiled vars:  !0 = $arr, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'array_push'
          3        SEND_REF                                                 !0
          4        INIT_ARRAY                                       ~2      !1, 'order_id'
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
    7     7      > RETURN                                                   !0
    8     8*     > RETURN                                                   null

End of function addtoarray

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.47 ms | 1398 KiB | 19 Q