3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mysort($a,$b){ return strlen($b)-strlen($a); } $data = array("kaushik","kaushik is","kaushik is great","is","is great","great"); usort($data,'mysort'); //print_r($data); $current = ""; for($i=0;$i<count($data);$i++) { $current=$data[$i]; for($j=$i+1;$j<count($data);$j++) { $current=str_replace($data[$j],"",$current); } if ($current!="") { echo $i." ".$current."\n"; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 8
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 8
Branch analysis from position: 34
Branch analysis from position: 8
Branch analysis from position: 30
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 13
Branch analysis from position: 24
Branch analysis from position: 13
filename:       /in/6AQZ4
function name:  (null)
number of ops:  35
compiled vars:  !0 = $data, !1 = $current, !2 = $i, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, <array>
   10     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'mysort'
          4        DO_ICALL                                                 
   15     5        ASSIGN                                                   !1, ''
   17     6        ASSIGN                                                   !2, 0
          7      > JMP                                                      ->31
   19     8    >   FETCH_DIM_R                                      ~8      !0, !2
          9        ASSIGN                                                   !1, ~8
   21    10        ADD                                              ~10     !2, 1
         11        ASSIGN                                                   !3, ~10
         12      > JMP                                                      ->21
   23    13    >   INIT_FCALL                                               'str_replace'
         14        FETCH_DIM_R                                      ~12     !0, !3
         15        SEND_VAL                                                 ~12
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $13     
         19        ASSIGN                                                   !1, $13
   21    20        PRE_INC                                                  !3
         21    >   COUNT                                            ~16     !0
         22        IS_SMALLER                                               !3, ~16
         23      > JMPNZ                                                    ~17, ->13
   26    24    >   IS_NOT_EQUAL                                             !1, ''
         25      > JMPZ                                                     ~18, ->30
   28    26    >   CONCAT                                           ~19     !2, '+'
         27        CONCAT                                           ~20     ~19, !1
         28        CONCAT                                           ~21     ~20, '%0A'
         29        ECHO                                                     ~21
   17    30    >   PRE_INC                                                  !2
         31    >   COUNT                                            ~23     !0
         32        IS_SMALLER                                               !2, ~23
         33      > JMPNZ                                                    ~24, ->8
   36    34    > > RETURN                                                   1

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

End of function mysort

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.89 ms | 1392 KiB | 17 Q