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) { $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); testAnagram($wyraz2); print_r($wyn1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/f0gLv
function name:  (null)
number of ops:  16
compiled vars:  !0 = $wyraz1, !1 = $wyraz2, !2 = $wyn1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'baba'
    5     1        ASSIGN                                                   !1, 'abba'
   17     2        INIT_FCALL                                               'testanagram'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $5      
          5        ASSIGN                                                   !2, $5
   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          
   21    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > 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/f0gLv
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:
140.54 ms | 1403 KiB | 19 Q