3v4l.org

run code in 300+ PHP versions simultaneously
<?php // palindrom function anagram($s1, $s2) { $l1 = strlen($s1); $l2 = strlen($s2); if($l1 != $l2) return false; // $w1 = array(); $w2 = array(); // for($a=0; $a<$l1; $a++) { if(array_key_exists($s1[$a], $w1)) { $w1[$s1[$a]] = $w1[$s1[$a]] + 1; print_r($s1[$a]); } else { $w1[$s1[$a]] = 1; } } print_r($w1); } print_r(anagram('test', 'test')); print_r(array('tesfsdf' => 'dasdsad'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/64dXs
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'anagram'
          2        SEND_VAL                                                 'test'
          3        SEND_VAL                                                 'test'
          4        DO_FCALL                                      0  $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                                 
   27     7        INIT_FCALL                                               'print_r'
          8        SEND_VAL                                                 <array>
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function anagram:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 13
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 13
Branch analysis from position: 33
Branch analysis from position: 13
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 13
Branch analysis from position: 33
Branch analysis from position: 13
filename:       /in/64dXs
function name:  anagram
number of ops:  37
compiled vars:  !0 = $s1, !1 = $s2, !2 = $l1, !3 = $l2, !4 = $w1, !5 = $w2, !6 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        STRLEN                                           ~7      !0
          3        ASSIGN                                                   !2, ~7
    5     4        STRLEN                                           ~9      !1
          5        ASSIGN                                                   !3, ~9
    7     6        IS_NOT_EQUAL                                             !2, !3
          7      > JMPZ                                                     ~11, ->9
    8     8    > > RETURN                                                   <false>
   10     9    >   ASSIGN                                                   !4, <array>
   11    10        ASSIGN                                                   !5, <array>
   13    11        ASSIGN                                                   !6, 0
         12      > JMP                                                      ->31
   14    13    >   FETCH_DIM_R                                      ~15     !0, !6
         14        ARRAY_KEY_EXISTS                                         ~15, !4
         15      > JMPZ                                                     ~16, ->27
   15    16    >   FETCH_DIM_R                                      ~17     !0, !6
         17        FETCH_DIM_R                                      ~19     !0, !6
         18        FETCH_DIM_R                                      ~20     !4, ~19
         19        ADD                                              ~21     ~20, 1
         20        ASSIGN_DIM                                               !4, ~17
         21        OP_DATA                                                  ~21
   16    22        INIT_FCALL                                               'print_r'
         23        FETCH_DIM_R                                      ~22     !0, !6
         24        SEND_VAL                                                 ~22
         25        DO_ICALL                                                 
         26      > JMP                                                      ->30
   19    27    >   FETCH_DIM_R                                      ~24     !0, !6
         28        ASSIGN_DIM                                               !4, ~24
         29        OP_DATA                                                  1
   13    30    >   PRE_INC                                                  !6
         31    >   IS_SMALLER                                               !6, !2
         32      > JMPNZ                                                    ~27, ->13
   23    33    >   INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !4
         35        DO_ICALL                                                 
   24    36      > RETURN                                                   null

End of function anagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.61 ms | 1394 KiB | 16 Q