3v4l.org

run code in 300+ PHP versions simultaneously
<?php $it = new ArrayIterator(array("Apples", "Bananas", "Cherries")); iterator_apply($it, function(Iterator $iterator) { echo strtoupper($iterator->current()) . "\n"; return TRUE; }, array($it));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2hFc2
function name:  (null)
number of ops:  12
compiled vars:  !0 = $it
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'ArrayIterator'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    4     4        INIT_FCALL                                               'iterator_apply'
          5        SEND_VAR                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2hFc2%3A4%240'
    7     7        SEND_VAL                                                 ~4
          8        INIT_ARRAY                                       ~5      !0
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F2hFc2%3A4%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2hFc2
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'strtoupper'
          2        INIT_METHOD_CALL                                         !0, 'current'
          3        DO_FCALL                                      0  $1      
          4        SEND_VAR                                                 $1
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    6     8      > RETURN                                                   <true>
    7     9*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F2hFc2%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.81 ms | 1387 KiB | 17 Q