3v4l.org

run code in 500+ PHP versions simultaneously
<?php $tsp = 9; $fin = [ "1701" => ["total_space" => 0, "count" => 0], "1702" => ["total_space" => 0, "count" => 0], "1703" => ["total_space" => 20, "count" => 20], "1704" => ["total_space" => 28, "count" => 28] ]; $qualifiers = array_filter($fin, fn($row) => $row['count']); $divideBy = count($qualifiers); foreach ($qualifiers as $id => $row) { $tsp -= $toAdd = ceil($tsp / $divideBy); --$divideBy; $fin[$id]['count'] += $toAdd; } var_export($fin);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/YbiNC
function name:  (null)
number of ops:  29
compiled vars:  !0 = $tsp, !1 = $fin, !2 = $qualifiers, !3 = $divideBy, !4 = $row, !5 = $id, !6 = $toAdd
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 9
    4     1        ASSIGN                                                       !1, <array>
   11     2        INIT_FCALL                                                   'array_filter'
          3        SEND_VAR                                                     !1
          4        DECLARE_LAMBDA_FUNCTION                              ~9      [0]
          5        SEND_VAL                                                     ~9
          6        DO_ICALL                                             $10     
          7        ASSIGN                                                       !2, $10
   12     8        COUNT                                                ~12     !2
          9        ASSIGN                                                       !3, ~12
   14    10      > FE_RESET_R                                           $14     !2, ->24
         11    > > FE_FETCH_R                                           ~15     $14, !4, ->24
         12    >   ASSIGN                                                       !5, ~15
   15    13        INIT_FCALL                                                   'ceil'
         14        DIV                                                  ~17     !0, !3
         15        SEND_VAL                                                     ~17
         16        DO_ICALL                                             $18     
         17        ASSIGN                                               ~19     !6, $18
         18        ASSIGN_OP                                         2          !0, ~19
   16    19        PRE_DEC                                                      !3
   17    20        FETCH_DIM_RW                                         $22     !1, !5
         21        ASSIGN_DIM_OP                    +=               1          $22, 'count'
         22        OP_DATA                                                      !6
   14    23      > JMP                                                          ->11
         24    >   FE_FREE                                                      $14
   19    25        INIT_FCALL                                                   'var_export'
         26        SEND_VAR                                                     !1
         27        DO_ICALL                                                     
         28      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YbiNC
function name:  {closure:/in/YbiNC:11}
number of ops:  4
compiled vars:  !0 = $row
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        FETCH_DIM_R                                          ~1      !0, 'count'
          2      > RETURN                                                       ~1
          3*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.7 ms | 1937 KiB | 16 Q