3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_any($arr, Callable $pred) { foreach ($arr as $elt) { if ($pred($elt)) { return true; } } return false; } $one = 'test'; $two = ''; $three = 'test'; var_dump(array_any([$one, $two, $three], 'empty'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bfITE
function name:  (null)
number of ops:  14
compiled vars:  !0 = $one, !1 = $two, !2 = $three
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, 'test'
   14     1        ASSIGN                                                   !1, ''
   15     2        ASSIGN                                                   !2, 'test'
   17     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL                                               'array_any'
          5        INIT_ARRAY                                       ~6      !0
          6        ADD_ARRAY_ELEMENT                                ~6      !1
          7        ADD_ARRAY_ELEMENT                                ~6      !2
          8        SEND_VAL                                                 ~6
          9        SEND_VAL                                                 'empty'
         10        DO_FCALL                                      0  $7      
         11        SEND_VAR                                                 $7
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function array_any:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/bfITE
function name:  array_any
number of ops:  14
compiled vars:  !0 = $arr, !1 = $pred, !2 = $elt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2      > FE_RESET_R                                       $3      !0, ->11
          3    > > FE_FETCH_R                                               $3, !2, ->11
    6     4    >   INIT_DYNAMIC_CALL                                        !1
          5        SEND_VAR_EX                                              !2
          6        DO_FCALL                                      0  $4      
          7      > JMPZ                                                     $4, ->10
    7     8    >   FE_FREE                                                  $3
          9      > RETURN                                                   <true>
    5    10    > > JMP                                                      ->3
         11    >   FE_FREE                                                  $3
   10    12      > RETURN                                                   <false>
   11    13*     > RETURN                                                   null

End of function array_any

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.73 ms | 1399 KiB | 16 Q