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(round((PHYSICS_SEMESTER_GRADE + $grade) / 2, 2), 1); $maths[$grade] = round(round((MATHS_SEMESTER_GRADE + $grade) / 2, 2), 1); } var_dump($physics, $maths);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 40
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 40
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/NS0D7
function name:  (null)
number of ops:  46
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, ->40
         12    > > FE_FETCH_R                                               $9, !3, ->40
    9    13    >   INIT_FCALL                                               'round'
         14        INIT_FCALL                                               'round'
         15        FETCH_CONSTANT                                   ~11     'PHYSICS_SEMESTER_GRADE'
         16        ADD                                              ~12     ~11, !3
         17        DIV                                              ~13     ~12, 2
         18        SEND_VAL                                                 ~13
         19        SEND_VAL                                                 2
         20        DO_ICALL                                         $14     
         21        SEND_VAR                                                 $14
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $15     
         24        ASSIGN_DIM                                               !1, !3
         25        OP_DATA                                                  $15
   10    26        INIT_FCALL                                               'round'
         27        INIT_FCALL                                               'round'
         28        FETCH_CONSTANT                                   ~17     'MATHS_SEMESTER_GRADE'
         29        ADD                                              ~18     ~17, !3
         30        DIV                                              ~19     ~18, 2
         31        SEND_VAL                                                 ~19
         32        SEND_VAL                                                 2
         33        DO_ICALL                                         $20     
         34        SEND_VAR                                                 $20
         35        SEND_VAL                                                 1
         36        DO_ICALL                                         $21     
         37        ASSIGN_DIM                                               !2, !3
         38        OP_DATA                                                  $21
    8    39      > JMP                                                      ->12
         40    >   FE_FREE                                                  $9
   13    41        INIT_FCALL                                               'var_dump'
         42        SEND_VAR                                                 !1
         43        SEND_VAR                                                 !2
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.21 ms | 1400 KiB | 19 Q