3v4l.org

run code in 300+ PHP versions simultaneously
<?php $found = NULL; $data = array( false, "foo", false, "bar", true, "baz", true, "trololo", false, "huehue" ); $data = array_filter($data, function($x) use (&$found) { if($x[0]) { $found = $x; return false; } return true; }); echo "Found:\n"; var_dump($found); echo "Data:\n"; var_dump($data);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Bq6Q
function name:  (null)
number of ops:  18
compiled vars:  !0 = $found, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, null
    4     1        ASSIGN                                                   !1, <array>
   12     2        INIT_FCALL                                               'array_filter'
          3        SEND_VAR                                                 !1
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F7Bq6Q%3A12%240'
          5        BIND_LEXICAL                                             ~4, !0
   18     6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
   12     8        ASSIGN                                                   !1, $5
   20     9        ECHO                                                     'Found%3A%0A'
   21    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
   22    13        ECHO                                                     'Data%3A%0A'
   23    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F7Bq6Q%3A12%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Bq6Q
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $x, !1 = $found
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   13     2        FETCH_DIM_R                                      ~2      !0, 0
          3      > JMPZ                                                     ~2, ->6
   14     4    >   ASSIGN                                                   !1, !0
   15     5      > RETURN                                                   <false>
   17     6    > > RETURN                                                   <true>
   18     7*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F7Bq6Q%3A12%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.53 ms | 1396 KiB | 17 Q