3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); print_r($a); $a = array_filter($a, function($n){ if($n % 2 == 0){ return TRUE; } return FALSE; }); print_r($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tGoGc
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        INIT_FCALL                                               'print_r'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    7     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FtGoGc%3A7%240'
   12     7        SEND_VAL                                                 ~3
          8        DO_ICALL                                         $4      
    7     9        ASSIGN                                                   !0, $4
   14    10        INIT_FCALL                                               'print_r'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FtGoGc%3A7%240:
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/tGoGc
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        MOD                                              ~1      !0, 2
          2        IS_EQUAL                                                 ~1, 0
          3      > JMPZ                                                     ~2, ->5
    9     4    > > RETURN                                                   <true>
   11     5    > > RETURN                                                   <false>
   12     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FtGoGc%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.58 ms | 1387 KiB | 17 Q