3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '3' => 10, '2' => 2, '5' => 'Nakiya', ); /** * Prepend a value to an array PHP */ function prependelement($array, $value) { array_unshift($array, $value); return $array; } var_dump(prependelement($array,'Jack'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XsLmv
function name:  (null)
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   23     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'prependelement'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'Jack'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function prependelement:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XsLmv
function name:  prependelement
number of ops:  8
compiled vars:  !0 = $array, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        INIT_FCALL                                               'array_unshift'
          3        SEND_REF                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
   20     6      > RETURN                                                   !0
   21     7*     > RETURN                                                   null

End of function prependelement

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.45 ms | 957 KiB | 16 Q