3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { function __construct() { $this->arr = array(1,34,3,98,9,76,45,4); } function joinNumbers($a, $b) { $t=10; while($b>=$t) $t*=10; return $a*$t+$b; } function arrangeNumbers() { $size=count($this->arr)/count($this->arr[0]); for($i=0;$i<$size-1;$i++) { for($j=$i+1;$j<$size;$j++) { if($this->joinNumbers($this->arr[$i],$this->arr[$j])<$this->joinNumbers($this->arr[$j],$this->arr[$i])) { $temp = $this->arr[$i]; $this->arr[$i] = $this->arr[$j]; $this->arr[$j] = $this->arr[$i]; } } } printf("Number is : "); for($i=0;$i<$size;$i++) { printf("%d",$this->arr[$i]); } printf("\n\n"); } } $test = new A; $test->arrangeNumbers();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQ3Xl
function name:  (null)
number of ops:  6
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   37     3        INIT_METHOD_CALL                                         !0, 'arrangeNumbers'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQ3Xl
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN_OBJ                                               'arr'
          1        OP_DATA                                                  <array>
    5     2      > RETURN                                                   null

End of function __construct

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/lQ3Xl
function name:  joinNumbers
number of ops:  11
compiled vars:  !0 = $a, !1 = $b, !2 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ASSIGN                                                   !2, 10
   10     3      > JMP                                                      ->5
   11     4    >   ASSIGN_OP                                     3          !2, 10
   10     5    >   IS_SMALLER_OR_EQUAL                                      !2, !1
          6      > JMPNZ                                                    ~5, ->4
   12     7    >   MUL                                              ~6      !0, !2
          8        ADD                                              ~7      ~6, !1
          9      > RETURN                                                   ~7
   13    10*     > RETURN                                                   null

End of function joinnumbers

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

End of function arrangenumbers

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.13 ms | 1404 KiB | 15 Q