3v4l.org

run code in 300+ PHP versions simultaneously
<?php function check($existing, $new) { $existingArray = explode(",", $existing); $newArray = explode(",", $new); if (count($newArray) !== count($existingArray)) return false; foreach ($newArray as $n) { if (!in_array($n, $existingArray)) return false; } return true; } $existingRecords = "1,3,4,6,5"; $newRecords = "6,4,3,1,5"; var_dump(check($existingRecords, $newRecords));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bbdqb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $existingRecords, !1 = $newRecords
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN                                                   !0, '1%2C3%2C4%2C6%2C5'
   13     1        ASSIGN                                                   !1, '6%2C4%2C3%2C1%2C5'
   14     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'check'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function check:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 28
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 28
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/bbdqb
function name:  check
number of ops:  31
compiled vars:  !0 = $existing, !1 = $new, !2 = $existingArray, !3 = $newArray, !4 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%2C'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    5     7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%2C'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $7      
         11        ASSIGN                                                   !3, $7
    6    12        COUNT                                            ~9      !3
         13        COUNT                                            ~10     !2
         14        IS_NOT_IDENTICAL                                         ~9, ~10
         15      > JMPZ                                                     ~11, ->17
         16    > > RETURN                                                   <false>
    7    17    > > FE_RESET_R                                       $12     !3, ->28
         18    > > FE_FETCH_R                                               $12, !4, ->28
    8    19    >   INIT_FCALL                                               'in_array'
         20        SEND_VAR                                                 !4
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $13     
         23        BOOL_NOT                                         ~14     $13
         24      > JMPZ                                                     ~14, ->27
         25    >   FE_FREE                                                  $12
         26      > RETURN                                                   <false>
    7    27    > > JMP                                                      ->18
         28    >   FE_FREE                                                  $12
   10    29      > RETURN                                                   <true>
   11    30*     > RETURN                                                   null

End of function check

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.46 ms | 1020 KiB | 17 Q