3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ratio = 1.583333333; $width = 960; $image_width = 3840; $image_height = 2560; $image_ratio = $image_width / $image_height; $width = ($image_ratio > $ratio) ? 9999 : $width; $height = ($image_ratio > $ratio) ? $width / $ratio : 9999; echo 'width:' . $width . ' / height:' . $height;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
Branch analysis from position: 17
filename:       /in/5asOF
function name:  (null)
number of ops:  24
compiled vars:  !0 = $ratio, !1 = $width, !2 = $image_width, !3 = $image_height, !4 = $image_ratio, !5 = $height
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 1.58333
    3     1        ASSIGN                                                   !1, 960
    4     2        ASSIGN                                                   !2, 3840
    5     3        ASSIGN                                                   !3, 2560
    6     4        DIV                                              ~10     !2, !3
          5        ASSIGN                                                   !4, ~10
    7     6        IS_SMALLER                                               !0, !4
          7      > JMPZ                                                     ~12, ->10
          8    >   QM_ASSIGN                                        ~13     9999
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~13     !1
         11    >   ASSIGN                                                   !1, ~13
    8    12        IS_SMALLER                                               !0, !4
         13      > JMPZ                                                     ~15, ->17
         14    >   DIV                                              ~16     !1, !0
         15        QM_ASSIGN                                        ~17     ~16
         16      > JMP                                                      ->18
         17    >   QM_ASSIGN                                        ~17     9999
         18    >   ASSIGN                                                   !5, ~17
    9    19        CONCAT                                           ~19     'width%3A', !1
         20        CONCAT                                           ~20     ~19, '+%2F+height%3A'
         21        CONCAT                                           ~21     ~20, !5
         22        ECHO                                                     ~21
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156 ms | 1394 KiB | 13 Q