3v4l.org

run code in 300+ PHP versions simultaneously
<?php $width = 300; $height = 150; $ratio = "2/1"; echo sscanf($ratio, '%d/%d'); 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 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0uIu9
function name:  (null)
number of ops:  31
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%2F1'
    8     3        INIT_FCALL                                               'sscanf'
          4        SEND_VAR                                                 !2
          5        SEND_VAL                                                 '%25d%2F%25d'
          6        DO_ICALL                                         $8      
          7        ECHO                                                     $8
   10     8        INIT_FCALL                                               'array_pad'
          9        INIT_FCALL                                               'sscanf'
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 '%25d%2F%25d'
         12        DO_ICALL                                         $9      
         13        SEND_VAR                                                 $9
         14        SEND_VAL                                                 2
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $10     
         17        FETCH_LIST_R                                     $11     $10, 0
         18        ASSIGN                                                   !3, $11
         19        FETCH_LIST_R                                     $13     $10, 1
         20        ASSIGN                                                   !4, $13
         21        FREE                                                     $10
   12    22        DIV                                              ~15     !3, !4
         23        DIV                                              ~16     !0, !1
         24        IS_EQUAL                                                 ~15, ~16
         25      > JMPZ                                                     ~17, ->28
         26    >   QM_ASSIGN                                        ~18     'true'
         27      > JMP                                                      ->29
         28    >   QM_ASSIGN                                        ~18     'false'
         29    >   ECHO                                                     ~18
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.86 ms | 1396 KiB | 17 Q