3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(array('name' => 'Artikkel #1', 'time' => 10), array('name' => 'Artikkel #2', 'time' => 5), array('name' => 'Artikkel #3', 'time' => 20)); function cmp($var) { if ($var['time'] < 10) return false; return true; } // Filter out articles where time is under 10 (<10) $result = array_filter($array, "cmp"); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibMeF
function name:  (null)
number of ops:  10
compiled vars:  !0 = $array, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        INIT_FCALL                                               'array_filter'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'cmp'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   15     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function cmp:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibMeF
function name:  cmp
number of ops:  7
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        FETCH_DIM_R                                      ~1      !0, 'time'
          2        IS_SMALLER                                               ~1, 10
          3      > JMPZ                                                     ~2, ->5
    7     4    > > RETURN                                                   <false>
    9     5    > > RETURN                                                   <true>
   10     6*     > RETURN                                                   null

End of function cmp

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.22 ms | 1395 KiB | 17 Q