3v4l.org

run code in 300+ PHP versions simultaneously
<?php $nr = 2; $nr_copy = 2; $a = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); $nr = 3; // you can freely modify $nr because the function below is using $nr_copy $a = array_filter($a, create_function('$e', ' global $nr_copy; return $e % $nr_copy == 0; ')); var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p0qYL
function name:  (null)
number of ops:  17
compiled vars:  !0 = $nr, !1 = $nr_copy, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 2
    3     1        ASSIGN                                                   !1, 2
    4     2        ASSIGN                                                   !2, <array>
    5     3        ASSIGN                                                   !0, 3
    6     4        INIT_FCALL                                               'array_filter'
          5        SEND_VAR                                                 !2
          6        INIT_FCALL_BY_NAME                                       'create_function'
          7        SEND_VAL_EX                                              '%24e'
          8        SEND_VAL_EX                                              '%0A++++global+%24nr_copy%3B%0A++++return+%24e+%25+%24nr_copy+%3D%3D+0%3B%0A'
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR                                                 $7
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !2, $8
   10    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.57 ms | 1394 KiB | 17 Q