3v4l.org

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

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

End of function swap

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.47 ms | 1403 KiB | 14 Q