3v4l.org

run code in 300+ PHP versions simultaneously
<?php function chargement($nbre, $nbreParChargement){ $niveaux = array(); if ($n = floor($nbre/$nbreParChargement)) { $niveaux = array_fill(0, $n, $nbreParChargement); } $niveaux[] = $nbre - array_sum($niveaux); return $niveaux; } var_dump(chargement(10, 4)); var_dump(chargement(14, 6)); var_dump(chargement(13, 16)); var_dump(chargement(30, 4));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SSALP
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'chargement'
          2        SEND_VAL                                                 10
          3        SEND_VAL                                                 4
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   14     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'chargement'
          9        SEND_VAL                                                 14
         10        SEND_VAL                                                 6
         11        DO_FCALL                                      0  $2      
         12        SEND_VAR                                                 $2
         13        DO_ICALL                                                 
   15    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'chargement'
         16        SEND_VAL                                                 13
         17        SEND_VAL                                                 16
         18        DO_FCALL                                      0  $4      
         19        SEND_VAR                                                 $4
         20        DO_ICALL                                                 
   16    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'chargement'
         23        SEND_VAL                                                 30
         24        SEND_VAL                                                 4
         25        DO_FCALL                                      0  $6      
         26        SEND_VAR                                                 $6
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Function chargement:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/SSALP
function name:  chargement
number of ops:  23
compiled vars:  !0 = $nbre, !1 = $nbreParChargement, !2 = $niveaux, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'floor'
          4        DIV                                              ~5      !0, !1
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                         $6      
          7        ASSIGN                                           ~7      !3, $6
          8      > JMPZ                                                     ~7, ->15
    6     9    >   INIT_FCALL                                               'array_fill'
         10        SEND_VAL                                                 0
         11        SEND_VAR                                                 !3
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !2, $8
    9    15    >   INIT_FCALL                                               'array_sum'
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $11     
         18        SUB                                              ~12     !0, $11
         19        ASSIGN_DIM                                               !2
         20        OP_DATA                                                  ~12
   10    21      > RETURN                                                   !2
   11    22*     > RETURN                                                   null

End of function chargement

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.74 ms | 1021 KiB | 21 Q