3v4l.org

run code in 300+ PHP versions simultaneously
<?php $width = 300; $height = 150; $ratio = "2:1"; list($numerator, $denominator) = array_pad(sscanf($ratio, '%d/%d'), 2, 1); echo $numerator / $denominator == $width / $height ? 'true' : 'false';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eM738
function name:  (null)
number of ops:  26
compiled vars:  !0 = $width, !1 = $height, !2 = $ratio, !3 = $numerator, !4 = $denominator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 300
    4     1        ASSIGN                                                   !1, 150
    6     2        ASSIGN                                                   !2, '2%3A1'
    8     3        INIT_FCALL                                               'array_pad'
          4        INIT_FCALL                                               'sscanf'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 '%25d%2F%25d'
          7        DO_ICALL                                         $8      
          8        SEND_VAR                                                 $8
          9        SEND_VAL                                                 2
         10        SEND_VAL                                                 1
         11        DO_ICALL                                         $9      
         12        FETCH_LIST_R                                     $10     $9, 0
         13        ASSIGN                                                   !3, $10
         14        FETCH_LIST_R                                     $12     $9, 1
         15        ASSIGN                                                   !4, $12
         16        FREE                                                     $9
   10    17        DIV                                              ~14     !3, !4
         18        DIV                                              ~15     !0, !1
         19        IS_EQUAL                                                 ~14, ~15
         20      > JMPZ                                                     ~16, ->23
         21    >   QM_ASSIGN                                        ~17     'true'
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~17     'false'
         24    >   ECHO                                                     ~17
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.53 ms | 940 KiB | 18 Q