3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = []; if ($x instanceof ArrayObject || $x instanceof ArrayAccess || $x instanceof Countable) { echo 'yes'; } else { echo 'no'; } $x = new ArrayObject([1,2,3]); function foo(array $a) { echo 'k'; } foo($x);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
2 jumps found. (Code = 47) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Branch analysis from position: 5
filename:       /in/aeII2
function name:  (null)
number of ops:  20
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INSTANCEOF                                       ~2      !0, 'ArrayObject'
          2      > JMPNZ_EX                                         ~2      ~2, ->5
          3    >   INSTANCEOF                                       ~3      !0, 'ArrayAccess'
          4        BOOL                                             ~2      ~3
          5    > > JMPNZ_EX                                         ~2      ~2, ->8
          6    >   INSTANCEOF                                       ~4      !0, 'Countable'
          7        BOOL                                             ~2      ~4
          8    > > JMPZ                                                     ~2, ->11
    5     9    >   ECHO                                                     'yes'
         10      > JMP                                                      ->12
    7    11    >   ECHO                                                     'no'
   11    12    >   NEW                                              $5      'ArrayObject'
         13        SEND_VAL_EX                                              <array>
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !0, $5
   16    16        INIT_FCALL                                               'foo'
         17        SEND_VAR                                                 !0
         18        DO_FCALL                                      0          
         19      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aeII2
function name:  foo
number of ops:  3
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        ECHO                                                     'k'
   14     2      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.01 ms | 1399 KiB | 14 Q