3v4l.org

run code in 300+ PHP versions simultaneously
<?php function image_fix_orientation(&$image, $filename) { $exif = exif_read_data($filename); if (!empty($exif['Orientation'])) { switch ($exif['Orientation']) { case 3: $image = imagerotate($image, 180, 0); break; case 6: $image = imagerotate($image, -90, 0); break; case 8: $image = imagerotate($image, 90, 0); break; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2dS7L
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E > > RETURN                                                   1

Function image_fix_orientation:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 39
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 31
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 39
filename:       /in/2dS7L
function name:  image_fix_orientation
number of ops:  40
compiled vars:  !0 = $image, !1 = $filename, !2 = $exif
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    3     2        INIT_FCALL_BY_NAME                                       'exif_read_data'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0  $3      
          5        ASSIGN                                                   !2, $3
    5     6        ISSET_ISEMPTY_DIM_OBJ                         1  ~5      !2, 'Orientation'
          7        BOOL_NOT                                         ~6      ~5
          8      > JMPZ                                                     ~6, ->39
    6     9    >   FETCH_DIM_R                                      ~7      !2, 'Orientation'
    7    10        CASE                                                     ~7, 3
         11      > JMPNZ                                                    ~8, ->17
   11    12    >   CASE                                                     ~7, 6
         13      > JMPNZ                                                    ~8, ->24
   15    14    >   CASE                                                     ~7, 8
         15      > JMPNZ                                                    ~8, ->31
         16    > > JMP                                                      ->38
    8    17    >   INIT_FCALL_BY_NAME                                       'imagerotate'
         18        SEND_VAR_EX                                              !0
         19        SEND_VAL_EX                                              180
         20        SEND_VAL_EX                                              0
         21        DO_FCALL                                      0  $9      
         22        ASSIGN                                                   !0, $9
    9    23      > JMP                                                      ->38
   12    24    >   INIT_FCALL_BY_NAME                                       'imagerotate'
         25        SEND_VAR_EX                                              !0
         26        SEND_VAL_EX                                              -90
         27        SEND_VAL_EX                                              0
         28        DO_FCALL                                      0  $11     
         29        ASSIGN                                                   !0, $11
   13    30      > JMP                                                      ->38
   16    31    >   INIT_FCALL_BY_NAME                                       'imagerotate'
         32        SEND_VAR_EX                                              !0
         33        SEND_VAL_EX                                              90
         34        SEND_VAL_EX                                              0
         35        DO_FCALL                                      0  $13     
         36        ASSIGN                                                   !0, $13
   17    37      > JMP                                                      ->38
         38    >   FREE                                                     ~7
   20    39    > > RETURN                                                   null

End of function image_fix_orientation

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.13 ms | 1399 KiB | 13 Q