3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Source: https://bugs.php.net/bug.php?id=61225 $wyraz1= "baba"; $wyraz2="abba"; function testAnagram($wyraz) { if (strlen($wyraz) == strlen(wyraz2)) { $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/1hteK
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, 'baba'
    5     1        ASSIGN                                                   !1, 'abba'
   18     2        INIT_FCALL                                               'testanagram'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !2, $6
   19     6        INIT_FCALL                                               'ksort'
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
   20     9        INIT_FCALL                                               'testanagram'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !3, $9
   21    13        INIT_FCALL                                               'ksort'
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   22    16        IS_EQUAL                                                 !2, !3
         17      > JMPZ                                                     ~12, ->20
   23    18    >   ECHO                                                     'identical'
         19      > JMP                                                      ->21
   24    20    >   ECHO                                                     'not+ident.'
   25    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
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 24
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 9
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 9
Branch analysis from position: 23
Branch analysis from position: 9
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 9
Branch analysis from position: 23
Branch analysis from position: 9
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1hteK
function name:  testAnagram
number of ops:  25
compiled vars:  !0 = $wyraz, !1 = $isAnagram, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        STRLEN                                           ~3      !0
          2        FETCH_CONSTANT                                   ~4      'wyraz2'
          3        STRLEN                                           ~5      ~4
          4        IS_EQUAL                                                 ~3, ~5
          5      > JMPZ                                                     ~6, ->24
    9     6    >   ASSIGN                                                   !1, <array>
   10     7        ASSIGN                                                   !2, 0
          8      > JMP                                                      ->20
   11     9    >   FETCH_DIM_R                                      ~9      !0, !2
         10        ISSET_ISEMPTY_DIM_OBJ                         0          !1, ~9
         11      > JMPZ                                                     ~10, ->16
         12    >   FETCH_DIM_R                                      ~11     !0, !2
         13        FETCH_DIM_RW                                     $12     !1, ~11
         14        PRE_INC                                                  $12
         15      > JMP                                                      ->19
   12    16    >   FETCH_DIM_R                                      ~14     !0, !2
         17        ASSIGN_DIM                                               !1, ~14
         18        OP_DATA                                                  1
   10    19    >   PRE_INC                                                  !2
         20    >   STRLEN                                           ~17     !0
         21        IS_SMALLER                                               !2, ~17
         22      > JMPNZ                                                    ~18, ->9
   14    23    > > RETURN                                                   !1
   16    24    > > RETURN                                                   null

End of function testanagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.75 ms | 1403 KiB | 19 Q