3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = ['1', '2']; $y = ['2', '1']; $z = ['1', '2', '4']; $n = [1, 2]; function array_equal($a, $b) { return ( is_array($a) && is_array($b) && count($a) == count($b) && array_diff($a, $b) === array_diff($b, $a) ); } echo array_equal($x, $y) ? 'y1' : 'n1'; echo array_equal($x, $z) ? 'y2' : 'n2'; echo array_equal($x, $n) ? 'y3' : 'n3';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
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
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
Branch analysis from position: 29
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Branch analysis from position: 20
filename:       /in/fqE53
function name:  (null)
number of ops:  32
compiled vars:  !0 = $x, !1 = $y, !2 = $z, !3 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ASSIGN                                                   !3, <array>
   19     4        INIT_FCALL                                               'array_equal'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $8      
          8      > JMPZ                                                     $8, ->11
          9    >   QM_ASSIGN                                        ~9      'y1'
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~9      'n1'
         12    >   ECHO                                                     ~9
   20    13        INIT_FCALL                                               'array_equal'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0  $10     
         17      > JMPZ                                                     $10, ->20
         18    >   QM_ASSIGN                                        ~11     'y2'
         19      > JMP                                                      ->21
         20    >   QM_ASSIGN                                        ~11     'n2'
         21    >   ECHO                                                     ~11
   21    22        INIT_FCALL                                               'array_equal'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !3
         25        DO_FCALL                                      0  $12     
         26      > JMPZ                                                     $12, ->29
         27    >   QM_ASSIGN                                        ~13     'y3'
         28      > JMP                                                      ->30
         29    >   QM_ASSIGN                                        ~13     'n3'
         30    >   ECHO                                                     ~13
         31      > RETURN                                                   1

Function array_equal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/fqE53
function name:  array_equal
number of ops:  24
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        TYPE_CHECK                                  128  ~2      !0
          3      > JMPZ_EX                                          ~2      ~2, ->6
   13     4    >   TYPE_CHECK                                  128  ~3      !1
          5        BOOL                                             ~2      ~3
          6    > > JMPZ_EX                                          ~2      ~2, ->11
   14     7    >   COUNT                                            ~4      !0
          8        COUNT                                            ~5      !1
          9        IS_EQUAL                                         ~6      ~4, ~5
         10        BOOL                                             ~2      ~6
         11    > > JMPZ_EX                                          ~2      ~2, ->22
   15    12    >   INIT_FCALL                                               'array_diff'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $7      
         16        INIT_FCALL                                               'array_diff'
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $8      
         20        IS_IDENTICAL                                     ~9      $7, $8
         21        BOOL                                             ~2      ~9
         22    > > RETURN                                                   ~2
   17    23*     > RETURN                                                   null

End of function array_equal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.8 ms | 1403 KiB | 18 Q