3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = new ArrayIterator(get_declared_classes()); $function = function($value, $key, $iterator) { return strpos($value, 'Exception'); }; $bar = new CallbackFilterIterator($foo, $function); echo 'Exceptions:' . PHP_EOL; foreach ($bar as $class) { echo $class . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 19
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/p5ZcN
function name:  (null)
number of ops:  21
compiled vars:  !0 = $foo, !1 = $function, !2 = $bar, !3 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'ArrayIterator'
          1        INIT_FCALL                                               'get_declared_classes'
          2        DO_ICALL                                         $5      
          3        SEND_VAR_NO_REF_EX                                       $5
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $4
    5     6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fp5ZcN%3A5%240'
          7        ASSIGN                                                   !1, ~8
    8     8        NEW                                              $10     'CallbackFilterIterator'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $10
   10    13        ECHO                                                     'Exceptions%3A%0A'
   11    14      > FE_RESET_R                                       $13     !2, ->19
         15    > > FE_FETCH_R                                               $13, !3, ->19
   12    16    >   CONCAT                                           ~14     !3, '%0A'
         17        ECHO                                                     ~14
   11    18      > JMP                                                      ->15
         19    >   FE_FREE                                                  $13
   13    20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2Fp5ZcN%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p5ZcN
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $value, !1 = $key, !2 = $iterator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    6     3        INIT_FCALL                                               'strpos'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 'Exception'
          6        DO_ICALL                                         $3      
          7      > RETURN                                                   $3
    7     8*     > RETURN                                                   null

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.27 ms | 1396 KiB | 17 Q