3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i=0; $j=500000; while($i < 60000) { $i++; $j++; $data1[] = md5($i); $data2[] = md5($j); } $time = microtime(true); echo "Starting array_filter\n"; $x = 0; $test = array_filter($data1, function($str) use (&$x) { return ++$x % 2 != 0; }); $test = array_filter($data2, function($str) use (&$x) { return ++$x % 2 != 0; }); unset($test); $time = microtime(true) - $time; echo 'array_filter() took ' . number_format($time, 3) . " seconds\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 3
Branch analysis from position: 17
Branch analysis from position: 3
filename:       /in/A9c40
function name:  (null)
number of ops:  51
compiled vars:  !0 = $i, !1 = $j, !2 = $data1, !3 = $data2, !4 = $time, !5 = $x, !6 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 0
          1        ASSIGN                                                   !1, 500000
    3     2      > JMP                                                      ->15
    4     3    >   PRE_INC                                                  !0
          4        PRE_INC                                                  !1
    5     5        INIT_FCALL                                               'md5'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $12     
          8        ASSIGN_DIM                                               !2
          9        OP_DATA                                                  $12
    6    10        INIT_FCALL                                               'md5'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $14     
         13        ASSIGN_DIM                                               !3
         14        OP_DATA                                                  $14
    3    15    >   IS_SMALLER                                               !0, 60000
         16      > JMPNZ                                                    ~15, ->3
    9    17    >   INIT_FCALL                                               'microtime'
         18        SEND_VAL                                                 <true>
         19        DO_ICALL                                         $16     
         20        ASSIGN                                                   !4, $16
   11    21        ECHO                                                     'Starting+array_filter%0A'
   13    22        ASSIGN                                                   !5, 0
   14    23        INIT_FCALL                                               'array_filter'
         24        SEND_VAR                                                 !2
         25        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FA9c40%3A14%240'
         26        BIND_LEXICAL                                             ~19, !5
   16    27        SEND_VAL                                                 ~19
         28        DO_ICALL                                         $20     
   14    29        ASSIGN                                                   !6, $20
   18    30        INIT_FCALL                                               'array_filter'
         31        SEND_VAR                                                 !3
         32        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FA9c40%3A18%241'
         33        BIND_LEXICAL                                             ~22, !5
   20    34        SEND_VAL                                                 ~22
         35        DO_ICALL                                         $23     
   18    36        ASSIGN                                                   !6, $23
   22    37        UNSET_CV                                                 !6
   24    38        INIT_FCALL                                               'microtime'
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $25     
         41        SUB                                              ~26     $25, !4
         42        ASSIGN                                                   !4, ~26
   26    43        INIT_FCALL                                               'number_format'
         44        SEND_VAR                                                 !4
         45        SEND_VAL                                                 3
         46        DO_ICALL                                         $28     
         47        CONCAT                                           ~29     'array_filter%28%29+took+', $28
         48        CONCAT                                           ~30     ~29, '+seconds%0A'
         49        ECHO                                                     ~30
         50      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FA9c40%3A14%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9c40
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $str, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   15     2        PRE_INC                                          ~2      !1
          3        MOD                                              ~3      ~2, 2
          4        IS_NOT_EQUAL                                     ~4      ~3, 0
          5      > RETURN                                                   ~4
   16     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FA9c40%3A14%240

Function %00%7Bclosure%7D%2Fin%2FA9c40%3A18%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/A9c40
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $str, !1 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   19     2        PRE_INC                                          ~2      !1
          3        MOD                                              ~3      ~2, 2
          4        IS_NOT_EQUAL                                     ~4      ~3, 0
          5      > RETURN                                                   ~4
   20     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FA9c40%3A18%241

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.24 ms | 1400 KiB | 21 Q