3v4l.org

run code in 300+ PHP versions simultaneously
<?php function chargement($nbre, $nbreParChargement){ $niveaux = array_fill(0, floor($nbre/$nbreParChargement), $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/FDKZI
function name:  (null)
number of ops:  29
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     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                                                 
   11     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                                                 
   12    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                                                 
   13    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
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FDKZI
function name:  chargement
number of ops:  20
compiled vars:  !0 = $nbre, !1 = $nbreParChargement, !2 = $niveaux
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'array_fill'
          3        SEND_VAL                                                 0
          4        INIT_FCALL                                               'floor'
          5        DIV                                              ~3      !0, !1
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !2, $5
    5    12        INIT_FCALL                                               'array_sum'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                         $8      
         15        SUB                                              ~9      !0, $8
         16        ASSIGN_DIM                                               !2
         17        OP_DATA                                                  ~9
    7    18      > RETURN                                                   !2
    8    19*     > RETURN                                                   null

End of function chargement

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.95 ms | 1021 KiB | 21 Q