3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('PHYSICS_SEMESTER_GRADE', 2.8); define('MATHS_SEMESTER_GRADE', 3.5); $grades = array(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6); $physics = $maths = []; foreach ($grades as $grade) { $physics[$grade] = round((PHYSICS_SEMESTER_GRADE + $grade) / 2, 1); $maths[$grade] = round((MATHS_SEMESTER_GRADE + $grade) / 2, 1); } var_dump($physics, $maths);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 32
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 32
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/GIPUh
function name:  (null)
number of ops:  38
compiled vars:  !0 = $grades, !1 = $physics, !2 = $maths, !3 = $grade
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'PHYSICS_SEMESTER_GRADE'
          2        SEND_VAL                                                 2.8
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'MATHS_SEMESTER_GRADE'
          6        SEND_VAL                                                 3.5
          7        DO_ICALL                                                 
    5     8        ASSIGN                                                   !0, <array>
    6     9        ASSIGN                                           ~7      !2, <array>
         10        ASSIGN                                                   !1, ~7
    8    11      > FE_RESET_R                                       $9      !0, ->32
         12    > > FE_FETCH_R                                               $9, !3, ->32
    9    13    >   INIT_FCALL                                               'round'
         14        FETCH_CONSTANT                                   ~11     'PHYSICS_SEMESTER_GRADE'
         15        ADD                                              ~12     ~11, !3
         16        DIV                                              ~13     ~12, 2
         17        SEND_VAL                                                 ~13
         18        SEND_VAL                                                 1
         19        DO_ICALL                                         $14     
         20        ASSIGN_DIM                                               !1, !3
         21        OP_DATA                                                  $14
   10    22        INIT_FCALL                                               'round'
         23        FETCH_CONSTANT                                   ~16     'MATHS_SEMESTER_GRADE'
         24        ADD                                              ~17     ~16, !3
         25        DIV                                              ~18     ~17, 2
         26        SEND_VAL                                                 ~18
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $19     
         29        ASSIGN_DIM                                               !2, !3
         30        OP_DATA                                                  $19
    8    31      > JMP                                                      ->12
         32    >   FE_FREE                                                  $9
   13    33        INIT_FCALL                                               'var_dump'
         34        SEND_VAR                                                 !1
         35        SEND_VAR                                                 !2
         36        DO_ICALL                                                 
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.97 ms | 1400 KiB | 19 Q