3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('first', 'second', 'third'); $pop = function () use (&$data) { list($key, $value) = each($data); unset($data[$key]); var_dump($key, $value); }; $pop(); $pop(); $pop(); echo "Length of data is " . count($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sUgrb
function name:  (null)
number of ops:  14
compiled vars:  !0 = $data, !1 = $pop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FsUgrb%3A5%240'
          2        BIND_LEXICAL                                             ~3, !0
          3        ASSIGN                                                   !1, ~3
   11     4        INIT_DYNAMIC_CALL                                        !1
          5        DO_FCALL                                      0          
   12     6        INIT_DYNAMIC_CALL                                        !1
          7        DO_FCALL                                      0          
   13     8        INIT_DYNAMIC_CALL                                        !1
          9        DO_FCALL                                      0          
   15    10        COUNT                                            ~8      !0
         11        CONCAT                                           ~9      'Length+of+data+is+', ~8
         12        ECHO                                                     ~9
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FsUgrb%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sUgrb
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $data, !1 = $key, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        INIT_FCALL_BY_NAME                                       'each'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0  $3      
          4        FETCH_LIST_R                                     $4      $3, 0
          5        ASSIGN                                                   !1, $4
          6        FETCH_LIST_R                                     $6      $3, 1
          7        ASSIGN                                                   !2, $6
          8        FREE                                                     $3
    7     9        UNSET_DIM                                                !0, !1
    8    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                                 
    9    14      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FsUgrb%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.42 ms | 1396 KiB | 18 Q