3v4l.org

run code in 300+ PHP versions simultaneously
<?php function start() { $GLOBALS['start'] = microtime(true); } function stop($return=false) { $time = microtime(true) - $GLOBALS['start']; if($return) { return $time; } else { printf("\n\n%.20f seconds\n\n", $time); } } for($i=1; $i<50000; $i++) { $csv[] = ["id"=>$i, "another_id"=>1]; $db[] = ["id"=>$i+10, "another_id"=>1]; } start(); // Get items that are in CSV but not in database $new = array_diff_key(array_column($csv, null, 'id'), array_column($db, null, 'id')); // Get items that are in database but not in CSV $del = array_diff_key(array_column($db, null, 'id'), array_column($csv, null, 'id')); stop();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/43okQ
function name:  (null)
number of ops:  49
compiled vars:  !0 = $i, !1 = $csv, !2 = $db, !3 = $new, !4 = $del
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 1
          1      > JMP                                                      ->12
   17     2    >   INIT_ARRAY                                       ~7      !0, 'id'
          3        ADD_ARRAY_ELEMENT                                ~7      1, 'another_id'
          4        ASSIGN_DIM                                               !1
          5        OP_DATA                                                  ~7
   18     6        ADD                                              ~9      !0, 10
          7        INIT_ARRAY                                       ~10     ~9, 'id'
          8        ADD_ARRAY_ELEMENT                                ~10     1, 'another_id'
          9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  ~10
   16    11        PRE_INC                                                  !0
         12    >   IS_SMALLER                                               !0, 50000
         13      > JMPNZ                                                    ~12, ->2
   21    14    >   INIT_FCALL                                               'start'
         15        DO_FCALL                                      0          
   23    16        INIT_FCALL                                               'array_diff_key'
         17        INIT_FCALL                                               'array_column'
         18        SEND_VAR                                                 !1
         19        SEND_VAL                                                 null
         20        SEND_VAL                                                 'id'
         21        DO_ICALL                                         $14     
         22        SEND_VAR                                                 $14
         23        INIT_FCALL                                               'array_column'
         24        SEND_VAR                                                 !2
         25        SEND_VAL                                                 null
         26        SEND_VAL                                                 'id'
         27        DO_ICALL                                         $15     
         28        SEND_VAR                                                 $15
         29        DO_ICALL                                         $16     
         30        ASSIGN                                                   !3, $16
   26    31        INIT_FCALL                                               'array_diff_key'
         32        INIT_FCALL                                               'array_column'
         33        SEND_VAR                                                 !2
         34        SEND_VAL                                                 null
         35        SEND_VAL                                                 'id'
         36        DO_ICALL                                         $18     
         37        SEND_VAR                                                 $18
         38        INIT_FCALL                                               'array_column'
         39        SEND_VAR                                                 !1
         40        SEND_VAL                                                 null
         41        SEND_VAL                                                 'id'
         42        DO_ICALL                                         $19     
         43        SEND_VAR                                                 $19
         44        DO_ICALL                                         $20     
         45        ASSIGN                                                   !4, $20
   27    46        INIT_FCALL                                               'stop'
         47        DO_FCALL                                      0          
         48      > RETURN                                                   1

Function start:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/43okQ
function name:  start
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'microtime'
          1        SEND_VAL                                                 <true>
          2        DO_ICALL                                         $1      
          3        FETCH_W                      global              $0      'start'
          4        ASSIGN                                                   $0, $1
    5     5      > RETURN                                                   null

End of function start

Function stop:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/43okQ
function name:  stop
number of ops:  15
compiled vars:  !0 = $return, !1 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      <false>
    8     1        INIT_FCALL                                               'microtime'
          2        SEND_VAL                                                 <true>
          3        DO_ICALL                                         $2      
          4        FETCH_R                      global              ~3      'start'
          5        SUB                                              ~4      $2, ~3
          6        ASSIGN                                                   !1, ~4
    9     7      > JMPZ                                                     !0, ->10
   10     8    > > RETURN                                                   !1
    9     9*       JMP                                                      ->14
   12    10    >   INIT_FCALL                                               'printf'
         11        SEND_VAL                                                 '%0A%0A%25.20f+seconds%0A%0A'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   14    14      > RETURN                                                   null

End of function stop

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.96 ms | 1010 KiB | 19 Q