3v4l.org

run code in 300+ PHP versions simultaneously
<?php function odd($var) { // является ли переданное число нечетным return($var & 1); } function even($var) { // является ли переданное число четным return(!($var & 1)); } $array1 = array("a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5); $array2 = array(6, 7, 8, 9, 10, 11, 12); echo "Нечетные:\n"; print_r(array_filter($array1, "odd")); echo "Четные:\n"; print_r(array_filter($array2, "even"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZLiN
function name:  (null)
number of ops:  19
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   17     2        ECHO                                                     '%D0%9D%D0%B5%D1%87%D0%B5%D1%82%D0%BD%D1%8B%D0%B5%3A%0A'
   18     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'odd'
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
   19    10        ECHO                                                     '%D0%A7%D0%B5%D1%82%D0%BD%D1%8B%D0%B5%3A%0A'
   20    11        INIT_FCALL                                               'print_r'
         12        INIT_FCALL                                               'array_filter'
         13        SEND_VAR                                                 !1
         14        SEND_VAL                                                 'even'
         15        DO_ICALL                                         $6      
         16        SEND_VAR                                                 $6
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function odd:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZLiN
function name:  odd
number of ops:  4
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        BW_AND                                           ~1      !0, 1
          2      > RETURN                                                   ~1
    6     3*     > RETURN                                                   null

End of function odd

Function even:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TZLiN
function name:  even
number of ops:  5
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   11     1        BW_AND                                           ~1      !0, 1
          2        BOOL_NOT                                         ~2      ~1
          3      > RETURN                                                   ~2
   12     4*     > RETURN                                                   null

End of function even

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.22 ms | 1396 KiB | 17 Q