3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = [11,12,13]; $code = ['1234','5678','9012']; $qty = [3,4,5]; $amount = [12.34,23.45,34.56]; //dry-run $op = '%s executed in %.8f seconds'; $start = $end = microtime(true); $max = count($id); $half = ceil($max/2); $data = []; for ($i=0; $i<$half; $i++) { $z = $max-($i+1); $data[$i] = [ 'id' => $id[$i], 'code' => $code[$i], 'qty' => $qty[$i], 'amount' => $amount[$i] ]; $data[$z] = [ 'id' => $id[$z], 'code' => $code[$z], 'qty' => $qty[$z], 'amount' => $amount[$z] ]; } //end dry-run $start = microtime(true); $max = count($id); $half = ceil($max/2); $data = []; for ($i=0; $i<$half; $i++) { $z = $max-($i+1); $data[$i] = [ 'id' => $id[$i], 'code' => $code[$i], 'qty' => $qty[$i], 'amount' => $amount[$i] ]; $data[$z] = [ 'id' => $id[$z], 'code' => $code[$z], 'qty' => $qty[$z], 'amount' => $amount[$z] ]; } $end = microtime(true); printf($op, 'for ceil', $end - $start);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 20
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 60
Branch analysis from position: 86
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 60
2 jumps found. (Code = 44) Position 1 = 86, Position 2 = 60
Branch analysis from position: 86
Branch analysis from position: 60
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 46, Position 2 = 20
Branch analysis from position: 46
Branch analysis from position: 20
filename:       /in/KHUul
function name:  (null)
number of ops:  97
compiled vars:  !0 = $id, !1 = $code, !2 = $qty, !3 = $amount, !4 = $op, !5 = $start, !6 = $end, !7 = $max, !8 = $half, !9 = $data, !10 = $i, !11 = $z
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
    9     4        ASSIGN                                                   !4, '%25s+executed+in+%25.8f+seconds'
   10     5        INIT_FCALL                                               'microtime'
          6        SEND_VAL                                                 <true>
          7        DO_ICALL                                         $17     
          8        ASSIGN                                           ~18     !6, $17
          9        ASSIGN                                                   !5, ~18
   11    10        COUNT                                            ~20     !0
         11        ASSIGN                                                   !7, ~20
   12    12        INIT_FCALL                                               'ceil'
         13        DIV                                              ~22     !7, 2
         14        SEND_VAL                                                 ~22
         15        DO_ICALL                                         $23     
         16        ASSIGN                                                   !8, $23
   13    17        ASSIGN                                                   !9, <array>
   14    18        ASSIGN                                                   !10, 0
         19      > JMP                                                      ->44
   15    20    >   ADD                                              ~27     !10, 1
         21        SUB                                              ~28     !7, ~27
         22        ASSIGN                                                   !11, ~28
   17    23        FETCH_DIM_R                                      ~31     !0, !10
         24        INIT_ARRAY                                       ~32     ~31, 'id'
   18    25        FETCH_DIM_R                                      ~33     !1, !10
         26        ADD_ARRAY_ELEMENT                                ~32     ~33, 'code'
   19    27        FETCH_DIM_R                                      ~34     !2, !10
         28        ADD_ARRAY_ELEMENT                                ~32     ~34, 'qty'
   20    29        FETCH_DIM_R                                      ~35     !3, !10
         30        ADD_ARRAY_ELEMENT                                ~32     ~35, 'amount'
   16    31        ASSIGN_DIM                                               !9, !10
   20    32        OP_DATA                                                  ~32
   24    33        FETCH_DIM_R                                      ~37     !0, !11
         34        INIT_ARRAY                                       ~38     ~37, 'id'
   25    35        FETCH_DIM_R                                      ~39     !1, !11
         36        ADD_ARRAY_ELEMENT                                ~38     ~39, 'code'
   26    37        FETCH_DIM_R                                      ~40     !2, !11
         38        ADD_ARRAY_ELEMENT                                ~38     ~40, 'qty'
   27    39        FETCH_DIM_R                                      ~41     !3, !11
         40        ADD_ARRAY_ELEMENT                                ~38     ~41, 'amount'
   23    41        ASSIGN_DIM                                               !9, !11
   27    42        OP_DATA                                                  ~38
   14    43        PRE_INC                                                  !10
         44    >   IS_SMALLER                                               !10, !8
         45      > JMPNZ                                                    ~43, ->20
   32    46    >   INIT_FCALL                                               'microtime'
         47        SEND_VAL                                                 <true>
         48        DO_ICALL                                         $44     
         49        ASSIGN                                                   !5, $44
   34    50        COUNT                                            ~46     !0
         51        ASSIGN                                                   !7, ~46
   35    52        INIT_FCALL                                               'ceil'
         53        DIV                                              ~48     !7, 2
         54        SEND_VAL                                                 ~48
         55        DO_ICALL                                         $49     
         56        ASSIGN                                                   !8, $49
   36    57        ASSIGN                                                   !9, <array>
   37    58        ASSIGN                                                   !10, 0
         59      > JMP                                                      ->84
   38    60    >   ADD                                              ~53     !10, 1
         61        SUB                                              ~54     !7, ~53
         62        ASSIGN                                                   !11, ~54
   40    63        FETCH_DIM_R                                      ~57     !0, !10
         64        INIT_ARRAY                                       ~58     ~57, 'id'
   41    65        FETCH_DIM_R                                      ~59     !1, !10
         66        ADD_ARRAY_ELEMENT                                ~58     ~59, 'code'
   42    67        FETCH_DIM_R                                      ~60     !2, !10
         68        ADD_ARRAY_ELEMENT                                ~58     ~60, 'qty'
   43    69        FETCH_DIM_R                                      ~61     !3, !10
         70        ADD_ARRAY_ELEMENT                                ~58     ~61, 'amount'
   39    71        ASSIGN_DIM                                               !9, !10
   43    72        OP_DATA                                                  ~58
   47    73        FETCH_DIM_R                                      ~63     !0, !11
         74        INIT_ARRAY                                       ~64     ~63, 'id'
   48    75        FETCH_DIM_R                                      ~65     !1, !11
         76        ADD_ARRAY_ELEMENT                                ~64     ~65, 'code'
   49    77        FETCH_DIM_R                                      ~66     !2, !11
         78        ADD_ARRAY_ELEMENT                                ~64     ~66, 'qty'
   50    79        FETCH_DIM_R                                      ~67     !3, !11
         80        ADD_ARRAY_ELEMENT                                ~64     ~67, 'amount'
   46    81        ASSIGN_DIM                                               !9, !11
   50    82        OP_DATA                                                  ~64
   37    83        PRE_INC                                                  !10
         84    >   IS_SMALLER                                               !10, !8
         85      > JMPNZ                                                    ~69, ->60
   54    86    >   INIT_FCALL                                               'microtime'
         87        SEND_VAL                                                 <true>
         88        DO_ICALL                                         $70     
         89        ASSIGN                                                   !6, $70
   55    90        INIT_FCALL                                               'printf'
         91        SEND_VAR                                                 !4
         92        SEND_VAL                                                 'for+ceil'
         93        SUB                                              ~72     !6, !5
         94        SEND_VAL                                                 ~72
         95        DO_ICALL                                                 
         96      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.02 ms | 1013 KiB | 16 Q