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,$wyraz2) { 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; } else {echo "rozne dlugosci";} } $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/hGWDt
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'
   19     2        INIT_FCALL                                               'testanagram'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !2, $6
   20     6        INIT_FCALL                                               'ksort'
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
   21     9        INIT_FCALL                                               'testanagram'
         10        SEND_VAR                                                 !1
         11        DO_FCALL                                      0  $9      
         12        ASSIGN                                                   !3, $9
   22    13        INIT_FCALL                                               'ksort'
         14        SEND_REF                                                 !3
         15        DO_ICALL                                                 
   23    16        IS_EQUAL                                                 !2, !3
         17      > JMPZ                                                     ~12, ->20
   24    18    >   ECHO                                                     'identical'
         19      > JMP                                                      ->21
   25    20    >   ECHO                                                     'not+ident.'
   26    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 = 25
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: 25
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hGWDt
function name:  testAnagram
number of ops:  27
compiled vars:  !0 = $wyraz, !1 = $wyraz2, !2 = $isAnagram, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        STRLEN                                           ~4      !0
          3        STRLEN                                           ~5      !1
          4        IS_EQUAL                                                 ~4, ~5
          5      > JMPZ                                                     ~6, ->25
    9     6    >   ASSIGN                                                   !2, <array>
   10     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->20
   11     9    >   FETCH_DIM_R                                      ~9      !0, !3
         10        ISSET_ISEMPTY_DIM_OBJ                         0          !2, ~9
         11      > JMPZ                                                     ~10, ->16
         12    >   FETCH_DIM_R                                      ~11     !0, !3
         13        FETCH_DIM_RW                                     $12     !2, ~11
         14        PRE_INC                                                  $12
         15      > JMP                                                      ->19
   12    16    >   FETCH_DIM_R                                      ~14     !0, !3
         17        ASSIGN_DIM                                               !2, ~14
         18        OP_DATA                                                  1
   10    19    >   PRE_INC                                                  !3
         20    >   STRLEN                                           ~17     !0
         21        IS_SMALLER                                               !3, ~17
         22      > JMPNZ                                                    ~18, ->9
   14    23    > > RETURN                                                   !2
         24*       JMP                                                      ->26
   16    25    >   ECHO                                                     'rozne+dlugosci'
   17    26      > RETURN                                                   null

End of function testanagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.58 ms | 1403 KiB | 19 Q