3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=61225 $wyraz1= "babc"; $wyraz2="abba"; function testAnagram($wyraz) { $isAnagram = array(); for ($i=0;$i<strlen($wyraz);$i++) { if (isset($isAnagram[$wyraz[$i]])) $isAnagram[$wyraz[$i]]++; else $isAnagram[$wyraz[$i]] = 1; } return $isAnagram; } $wyn1 = testAnagram($wyraz1); ksort($wyn1); $wyn2 = testAnagram($wyraz2); ksort($wyn2); if ($wyn1 == $wyn2) { echo "identical"; } else {echo "not ident.";} print_r($wyn1);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8MGaP
function name:  (null)
number of ops:  25
compiled vars:  !0 = $wyraz1, !1 = $wyraz2, !2 = $wyn1, !3 = $wyn2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'babc'
    5     1        ASSIGN                                                   !1, 'abba'
   17     2        INIT_FCALL                                               'testanagram'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !2, $6
   18     6        INIT_FCALL                                               'ksort'
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
   19     9        INIT_FCALL                                               'testanagram'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !3, $9
   20    13        INIT_FCALL                                               'ksort'
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   21    16        IS_EQUAL                                                 !2, !3
         17      > JMPZ                                                     ~12, ->20
   22    18    >   ECHO                                                     'identical'
         19      > JMP                                                      ->21
   23    20    >   ECHO                                                     'not+ident.'
   24    21    >   INIT_FCALL                                               'print_r'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function testanagram:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
Branch analysis from position: 4
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 4
Branch analysis from position: 18
Branch analysis from position: 4
filename:       /in/8MGaP
function name:  testAnagram
number of ops:  20
compiled vars:  !0 = $wyraz, !1 = $isAnagram, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ASSIGN                                                   !1, <array>
   10     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->15
   11     4    >   FETCH_DIM_R                                      ~5      !0, !2
          5        ISSET_ISEMPTY_DIM_OBJ                         0          !1, ~5
          6      > JMPZ                                                     ~6, ->11
          7    >   FETCH_DIM_R                                      ~7      !0, !2
          8        FETCH_DIM_RW                                     $8      !1, ~7
          9        PRE_INC                                                  $8
         10      > JMP                                                      ->14
   12    11    >   FETCH_DIM_R                                      ~10     !0, !2
         12        ASSIGN_DIM                                               !1, ~10
         13        OP_DATA                                                  1
   10    14    >   PRE_INC                                                  !2
         15    >   STRLEN                                           ~13     !0
         16        IS_SMALLER                                               !2, ~13
         17      > JMPNZ                                                    ~14, ->4
   14    18    > > RETURN                                                   !1
   15    19*     > RETURN                                                   null

End of function testanagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.4 ms | 1403 KiB | 19 Q