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; return ($s1); // $w1 = array(); $w2 = array(); // for($a=0; $a<$l1; $a++) { if(array_key_exists($s1[$a], $w1)) $w1[$s1[$a]] = $w1[$s1[$a]] + 1; 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/8seJO
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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                                                 
   25     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 = 62) Position 1 = -2
filename:       /in/8seJO
function name:  anagram
number of ops:  34
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>
    9     9    > > RETURN                                                   !0
   11    10*       ASSIGN                                                   !4, <array>
   12    11*       ASSIGN                                                   !5, <array>
   14    12*       ASSIGN                                                   !6, 0
         13*       JMP                                                      ->28
   15    14*       FETCH_DIM_R                                      ~15     !0, !6
         15*       ARRAY_KEY_EXISTS                                         ~15, !4
         16*       JMPZ                                                     ~16, ->24
   16    17*       FETCH_DIM_R                                      ~17     !0, !6
         18*       FETCH_DIM_R                                      ~19     !0, !6
         19*       FETCH_DIM_R                                      ~20     !4, ~19
         20*       ADD                                              ~21     ~20, 1
         21*       ASSIGN_DIM                                               !4, ~17
         22*       OP_DATA                                                  ~21
         23*       JMP                                                      ->27
   18    24*       FETCH_DIM_R                                      ~22     !0, !6
         25*       ASSIGN_DIM                                               !4, ~22
         26*       OP_DATA                                                  1
   14    27*       PRE_INC                                                  !6
         28*       IS_SMALLER                                               !6, !2
         29*       JMPNZ                                                    ~25, ->14
   21    30*       INIT_FCALL                                               'print_r'
         31*       SEND_VAR                                                 !4
         32*       DO_ICALL                                                 
   22    33*     > RETURN                                                   null

End of function anagram

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.94 ms | 1403 KiB | 16 Q