3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fileSize = new fileSize(); $minHeight = 180; $minWidth = 180; if ($fileSize->getWidth() > $fileSize->getHeight()) { if ($fileSize->getHeight() > $minHeight) { $width = round($fileSize->getWidth() * ($minHeight / $fileSize->getHeight())); $height = $shortestSide; } } elseif ($fileSize->getHeight() > $fileSize->getWidth()) { $height = round($fileSize->getHeight() * ($minWidth / $fileSize->getWidth())); $width = $shortestSide; } elseif ($height === $width) { $height = $minHeight; $width = $minWidth; } return ['width' => $width, 'height' => $height]; class fileSize { public function getWidth() { return 1200; } public function getHeight() { return 630; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 26
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 45
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/nWLM4
function name:  (null)
number of ops:  53
compiled vars:  !0 = $fileSize, !1 = $minHeight, !2 = $minWidth, !3 = $width, !4 = $height, !5 = $shortestSide
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $6      'fileSize'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $6
    4     3        ASSIGN                                                   !1, 180
    5     4        ASSIGN                                                   !2, 180
    7     5        INIT_METHOD_CALL                                         !0, 'getWidth'
          6        DO_FCALL                                      0  $11     
          7        INIT_METHOD_CALL                                         !0, 'getHeight'
          8        DO_FCALL                                      0  $12     
          9        IS_SMALLER                                               $12, $11
         10      > JMPZ                                                     ~13, ->27
    8    11    >   INIT_METHOD_CALL                                         !0, 'getHeight'
         12        DO_FCALL                                      0  $14     
         13        IS_SMALLER                                               !1, $14
         14      > JMPZ                                                     ~15, ->26
    9    15    >   INIT_FCALL                                               'round'
         16        INIT_METHOD_CALL                                         !0, 'getWidth'
         17        DO_FCALL                                      0  $16     
         18        INIT_METHOD_CALL                                         !0, 'getHeight'
         19        DO_FCALL                                      0  $17     
         20        DIV                                              ~18     !1, $17
         21        MUL                                              ~19     $16, ~18
         22        SEND_VAL                                                 ~19
         23        DO_ICALL                                         $20     
         24        ASSIGN                                                   !3, $20
   10    25        ASSIGN                                                   !4, !5
         26    > > JMP                                                      ->49
   12    27    >   INIT_METHOD_CALL                                         !0, 'getHeight'
         28        DO_FCALL                                      0  $23     
         29        INIT_METHOD_CALL                                         !0, 'getWidth'
         30        DO_FCALL                                      0  $24     
         31        IS_SMALLER                                               $24, $23
         32      > JMPZ                                                     ~25, ->45
   13    33    >   INIT_FCALL                                               'round'
         34        INIT_METHOD_CALL                                         !0, 'getHeight'
         35        DO_FCALL                                      0  $26     
         36        INIT_METHOD_CALL                                         !0, 'getWidth'
         37        DO_FCALL                                      0  $27     
         38        DIV                                              ~28     !2, $27
         39        MUL                                              ~29     $26, ~28
         40        SEND_VAL                                                 ~29
         41        DO_ICALL                                         $30     
         42        ASSIGN                                                   !4, $30
   14    43        ASSIGN                                                   !3, !5
         44      > JMP                                                      ->49
   15    45    >   IS_IDENTICAL                                             !4, !3
         46      > JMPZ                                                     ~33, ->49
   16    47    >   ASSIGN                                                   !4, !1
   17    48        ASSIGN                                                   !3, !2
   20    49    >   INIT_ARRAY                                       ~36     !3, 'width'
         50        ADD_ARRAY_ELEMENT                                ~36     !4, 'height'
         51      > RETURN                                                   ~36
   33    52*     > RETURN                                                   1

Class fileSize:
Function getwidth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nWLM4
function name:  getWidth
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E > > RETURN                                                   1200
   27     1*     > RETURN                                                   null

End of function getwidth

Function getheight:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nWLM4
function name:  getHeight
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   630
   32     1*     > RETURN                                                   null

End of function getheight

End of class fileSize.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.32 ms | 1405 KiB | 15 Q