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 $data[$i]."\n"; } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
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: 32
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 16
Branch analysis from position: 27
Branch analysis from position: 16
filename:       /in/4E0Sa
function name:  (null)
number of ops:  37
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                                                 
   13     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   15     8        ASSIGN                                                   !1, ''
   17     9        ASSIGN                                                   !2, 0
         10      > JMP                                                      ->33
   19    11    >   FETCH_DIM_R                                      ~9      !0, !2
         12        ASSIGN                                                   !1, ~9
   21    13        ADD                                              ~11     !2, 1
         14        ASSIGN                                                   !3, ~11
         15      > JMP                                                      ->24
   23    16    >   INIT_FCALL                                               'str_replace'
         17        FETCH_DIM_R                                      ~13     !0, !3
         18        SEND_VAL                                                 ~13
         19        SEND_VAL                                                 ''
         20        SEND_VAR                                                 !1
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !1, $14
   21    23        PRE_INC                                                  !3
         24    >   COUNT                                            ~17     !0
         25        IS_SMALLER                                               !3, ~17
         26      > JMPNZ                                                    ~18, ->16
   26    27    >   IS_EQUAL                                                 !1, ''
         28      > JMPZ                                                     ~19, ->32
   28    29    >   FETCH_DIM_R                                      ~20     !0, !2
         30        CONCAT                                           ~21     ~20, '%0A'
         31        ECHO                                                     ~21
   17    32    >   PRE_INC                                                  !2
         33    >   COUNT                                            ~23     !0
         34        IS_SMALLER                                               !2, ~23
         35      > JMPNZ                                                    ~24, ->11
   36    36    > > RETURN                                                   1

Function mysort:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4E0Sa
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:
175.02 ms | 1400 KiB | 19 Q