3v4l.org

run code in 300+ PHP versions simultaneously
<?php $i = imagecreatefrompng("http://in-the-attic.com/img/posts/teaching-my-5-year-old-daughter-to-code/script_before.png"); for ($x=0;$x<imagesx($i);$x++) { for ($y=0;$y<imagesy($i);$y++) { $rgb = imagecolorat($i,$x,$y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $rTotal += $r; $gTotal += $g; $bTotal += $b; $total++; } } echo round($rTotal/$total); echo round($gTotal/$total); echo round($bTotal/$total);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 6
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 8
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 6
Branch analysis from position: 38
Branch analysis from position: 6
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 8
Branch analysis from position: 32
Branch analysis from position: 8
filename:       /in/CrXpW
function name:  (null)
number of ops:  54
compiled vars:  !0 = $i, !1 = $x, !2 = $y, !3 = $rgb, !4 = $r, !5 = $g, !6 = $b, !7 = $rTotal, !8 = $gTotal, !9 = $bTotal, !10 = $total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'imagecreatefrompng'
          1        SEND_VAL_EX                                              'http%3A%2F%2Fin-the-attic.com%2Fimg%2Fposts%2Fteaching-my-5-year-old-daughter-to-code%2Fscript_before.png'
          2        DO_FCALL                                      0  $11     
          3        ASSIGN                                                   !0, $11
    4     4        ASSIGN                                                   !1, 0
          5      > JMP                                                      ->33
    5     6    >   ASSIGN                                                   !2, 0
          7      > JMP                                                      ->27
    6     8    >   INIT_FCALL_BY_NAME                                       'imagecolorat'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAR_EX                                              !1
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0  $15     
         13        ASSIGN                                                   !3, $15
    7    14        SR                                               ~17     !3, 16
         15        BW_AND                                           ~18     ~17, 255
         16        ASSIGN                                                   !4, ~18
    8    17        SR                                               ~20     !3, 8
         18        BW_AND                                           ~21     ~20, 255
         19        ASSIGN                                                   !5, ~21
    9    20        BW_AND                                           ~23     !3, 255
         21        ASSIGN                                                   !6, ~23
   11    22        ASSIGN_OP                                     1          !7, !4
   12    23        ASSIGN_OP                                     1          !8, !5
   13    24        ASSIGN_OP                                     1          !9, !6
   14    25        PRE_INC                                                  !10
    5    26        PRE_INC                                                  !2
         27    >   INIT_FCALL_BY_NAME                                       'imagesy'
         28        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $30     
         30        IS_SMALLER                                               !2, $30
         31      > JMPNZ                                                    ~31, ->8
    4    32    >   PRE_INC                                                  !1
         33    >   INIT_FCALL_BY_NAME                                       'imagesx'
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0  $33     
         36        IS_SMALLER                                               !1, $33
         37      > JMPNZ                                                    ~34, ->6
   18    38    >   INIT_FCALL                                               'round'
         39        DIV                                              ~35     !7, !10
         40        SEND_VAL                                                 ~35
         41        DO_ICALL                                         $36     
         42        ECHO                                                     $36
   19    43        INIT_FCALL                                               'round'
         44        DIV                                              ~37     !8, !10
         45        SEND_VAL                                                 ~37
         46        DO_ICALL                                         $38     
         47        ECHO                                                     $38
   20    48        INIT_FCALL                                               'round'
         49        DIV                                              ~39     !9, !10
         50        SEND_VAL                                                 ~39
         51        DO_ICALL                                         $40     
         52        ECHO                                                     $40
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.06 ms | 1405 KiB | 15 Q