3v4l.org

run code in 500+ PHP versions simultaneously
<?php $stack = array("orange", "banana", "apple", "raspberry"); $fruit = fn(&$s) => array_shift($s); var_dump($fruit($stack)); var_dump($fruit($stack)); var_dump($fruit($stack)); var_dump($fruit($stack));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XElrH
function name:  (null)
number of ops:  28
compiled vars:  !0 = $stack, !1 = $fruit
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        DECLARE_LAMBDA_FUNCTION                              ~3      [0]
          2        ASSIGN                                                       !1, ~3
    6     3        INIT_FCALL                                                   'var_dump'
          4        INIT_DYNAMIC_CALL                                            !1
          5        SEND_VAR_EX                                                  !0
          6        DO_FCALL                                          0  $5      
          7        SEND_VAR                                                     $5
          8        DO_ICALL                                                     
    7     9        INIT_FCALL                                                   'var_dump'
         10        INIT_DYNAMIC_CALL                                            !1
         11        SEND_VAR_EX                                                  !0
         12        DO_FCALL                                          0  $7      
         13        SEND_VAR                                                     $7
         14        DO_ICALL                                                     
    8    15        INIT_FCALL                                                   'var_dump'
         16        INIT_DYNAMIC_CALL                                            !1
         17        SEND_VAR_EX                                                  !0
         18        DO_FCALL                                          0  $9      
         19        SEND_VAR                                                     $9
         20        DO_ICALL                                                     
    9    21        INIT_FCALL                                                   'var_dump'
         22        INIT_DYNAMIC_CALL                                            !1
         23        SEND_VAR_EX                                                  !0
         24        DO_FCALL                                          0  $11     
         25        SEND_VAR                                                     $11
         26        DO_ICALL                                                     
         27      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XElrH
function name:  {closure:/in/XElrH:4}
number of ops:  6
compiled vars:  !0 = $s
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'array_shift'
          2        SEND_REF                                                     !0
          3        DO_ICALL                                             $1      
          4      > RETURN                                                       $1
          5*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.29 ms | 2178 KiB | 15 Q