3v4l.org

run code in 300+ PHP versions simultaneously
<?php function swap($a, $b) { $temp = $a; $a = $b; $b = $a; } $a=10; $b=5; if($a>$b) { swap($a, $b); } for($i=$a; $i<=$b; $i++) { echo $i." "; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 10
Branch analysis from position: 15
Branch analysis from position: 10
Branch analysis from position: 8
filename:       /in/kcCmd
function name:  (null)
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ASSIGN                                                   !0, 10
   10     1        ASSIGN                                                   !1, 5
   12     2        IS_SMALLER                                               !1, !0
          3      > JMPZ                                                     ~5, ->8
   14     4    >   INIT_FCALL                                               'swap'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0          
   16     8    >   ASSIGN                                                   !2, !0
          9      > JMP                                                      ->13
   18    10    >   CONCAT                                           ~8      !2, '+'
         11        ECHO                                                     ~8
   16    12        PRE_INC                                                  !2
         13    >   IS_SMALLER_OR_EQUAL                                      !2, !1
         14      > JMPNZ                                                    ~10, ->10
   20    15    > > RETURN                                                   1

Function swap:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kcCmd
function name:  swap
number of ops:  6
compiled vars:  !0 = $a, !1 = $b, !2 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, !0
    5     3        ASSIGN                                                   !0, !1
    6     4        ASSIGN                                                   !1, !0
    7     5      > RETURN                                                   null

End of function swap

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.46 ms | 1398 KiB | 14 Q