3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = [1,2,3,4,5]; function array_pop_unshift($array) { array_unshift($array, array_pop($array)); return $array; } print_r(array_pop_unshift($a));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CoJZZ
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        INIT_FCALL                                                   'print_r'
          2        INIT_FCALL                                                   'array_pop_unshift'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $2      
          5        SEND_VAR                                                     $2
          6        DO_ICALL                                                     
          7      > RETURN                                                       1

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

End of function array_pop_unshift

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
173.46 ms | 2197 KiB | 17 Q