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) ? $image_width / $image_ratio : $width; $height = $width * $image_ratio; echo 'width:' . $width . ' / height:' . $height;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7b3BM
function name:  (null)
number of ops:  20
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, ->11
          8    >   DIV                                              ~13     !2, !4
          9        QM_ASSIGN                                        ~14     ~13
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~14     !1
         12    >   ASSIGN                                                   !1, ~14
    8    13        MUL                                              ~16     !1, !4
         14        ASSIGN                                                   !5, ~16
    9    15        CONCAT                                           ~18     'width%3A', !1
         16        CONCAT                                           ~19     ~18, '+%2F+height%3A'
         17        CONCAT                                           ~20     ~19, !5
         18        ECHO                                                     ~20
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
198.65 ms | 1393 KiB | 13 Q