3v4l.org

run code in 300+ PHP versions simultaneously
<?php function joinNumbers($a, $b) { $t=10; while($b>=$t) $t*=10; return $a*$t+$b; } function arrangeNumbers() { $a = [1,34,3,98,9,76,45,4]; $size=count($a)/count($a[0]); for($i=0;$i<$size-1;$i++) for($j=$i+1;$j<$size;$j++) if(joinNumbers($a[$i],$a[$j])<joinNumbers($a[$j],$a[$i])) swap($a[$i],$a[$j]); printf("Number is : "); for($i=0;$i<$size;$i++) printf("%d",$a[$i]); printf("\n\n"); } arrangeNumbers();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GuuYD
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'arrangenumbers'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function joinnumbers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 4
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 4
Branch analysis from position: 7
Branch analysis from position: 4
filename:       /in/GuuYD
function name:  joinNumbers
number of ops:  11
compiled vars:  !0 = $a, !1 = $b, !2 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, 10
    6     3      > JMP                                                      ->5
    7     4    >   ASSIGN_OP                                     3          !2, 10
    6     5    >   IS_SMALLER_OR_EQUAL                                      !2, !1
          6      > JMPNZ                                                    ~5, ->4
    8     7    >   MUL                                              ~6      !0, !2
          8        ADD                                              ~7      ~6, !1
          9      > RETURN                                                   ~7
    9    10*     > RETURN                                                   null

End of function joinnumbers

Function arrangenumbers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 8
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 45
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 45
Branch analysis from position: 53
Branch analysis from position: 45
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 8
Branch analysis from position: 40
Branch analysis from position: 8
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
Branch analysis from position: 11
Branch analysis from position: 33
filename:       /in/GuuYD
function name:  arrangeNumbers
number of ops:  57
compiled vars:  !0 = $a, !1 = $size, !2 = $i, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN                                                   !0, <array>
   15     1        COUNT                                            ~5      !0
          2        FETCH_DIM_R                                      ~6      !0, 0
          3        COUNT                                            ~7      ~6
          4        DIV                                              ~8      ~5, ~7
          5        ASSIGN                                                   !1, ~8
   17     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->37
   18     8    >   ADD                                              ~11     !2, 1
          9        ASSIGN                                                   !3, ~11
         10      > JMP                                                      ->34
   19    11    >   INIT_FCALL                                               'joinnumbers'
         12        FETCH_DIM_R                                      ~13     !0, !2
         13        SEND_VAL                                                 ~13
         14        FETCH_DIM_R                                      ~14     !0, !3
         15        SEND_VAL                                                 ~14
         16        DO_FCALL                                      0  $15     
         17        INIT_FCALL                                               'joinnumbers'
         18        FETCH_DIM_R                                      ~16     !0, !3
         19        SEND_VAL                                                 ~16
         20        FETCH_DIM_R                                      ~17     !0, !2
         21        SEND_VAL                                                 ~17
         22        DO_FCALL                                      0  $18     
         23        IS_SMALLER                                               $15, $18
         24      > JMPZ                                                     ~19, ->33
   20    25    >   INIT_FCALL_BY_NAME                                       'swap'
         26        CHECK_FUNC_ARG                                           
         27        FETCH_DIM_FUNC_ARG                               $20     !0, !2
         28        SEND_FUNC_ARG                                            $20
         29        CHECK_FUNC_ARG                                           
         30        FETCH_DIM_FUNC_ARG                               $21     !0, !3
         31        SEND_FUNC_ARG                                            $21
         32        DO_FCALL                                      0          
   18    33    >   PRE_INC                                                  !3
         34    >   IS_SMALLER                                               !3, !1
         35      > JMPNZ                                                    ~24, ->11
   17    36    >   PRE_INC                                                  !2
         37    >   SUB                                              ~26     !1, 1
         38        IS_SMALLER                                               !2, ~26
         39      > JMPNZ                                                    ~27, ->8
   22    40    >   INIT_FCALL                                               'printf'
         41        SEND_VAL                                                 'Number+is+%3A+'
         42        DO_ICALL                                                 
   23    43        ASSIGN                                                   !2, 0
         44      > JMP                                                      ->51
   24    45    >   INIT_FCALL                                               'printf'
         46        SEND_VAL                                                 '%25d'
         47        FETCH_DIM_R                                      ~30     !0, !2
         48        SEND_VAL                                                 ~30
         49        DO_ICALL                                                 
   23    50        PRE_INC                                                  !2
         51    >   IS_SMALLER                                               !2, !1
         52      > JMPNZ                                                    ~33, ->45
   26    53    >   INIT_FCALL                                               'printf'
         54        SEND_VAL                                                 '%0A%0A'
         55        DO_ICALL                                                 
   27    56      > RETURN                                                   null

End of function arrangenumbers

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.62 ms | 1411 KiB | 18 Q