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, $test], function($elt) { return empty($elt); }));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DOSAO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $one, !1 = $two, !2 = $three, !3 = $test
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                                       ~7      !0
          6        ADD_ARRAY_ELEMENT                                ~7      !1
          7        ADD_ARRAY_ELEMENT                                ~7      !3
          8        SEND_VAL                                                 ~7
          9        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FDOSAO%3A17%240'
         10        SEND_VAL                                                 ~8
         11        DO_FCALL                                      0  $9      
         12        SEND_VAR                                                 $9
         13        DO_ICALL                                                 
         14      > 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/DOSAO
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

Function %00%7Bclosure%7D%2Fin%2FDOSAO%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DOSAO
function name:  {closure}
number of ops:  4
compiled vars:  !0 = $elt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        ISSET_ISEMPTY_CV                                 ~1      !0
          2      > RETURN                                                   ~1
          3*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FDOSAO%3A17%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.82 ms | 1403 KiB | 16 Q