3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Foo; $a = [1, 2, 3]; \in_array($b, $a, true); // not optimized because variable array \in_array($b, [1, 2, 3]); // not optimized because missing strict param in_array($b, [1, 2, 3], true); // not optimized because no leading `\` or import \in_array($b, [1, 2, 3], true); // optimized
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FjKJ0
function name:  (null)
number of ops:  18
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_FCALL                                               'in_array'
          2        SEND_VAR                                                 !1
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'in_array'
          7        SEND_VAR                                                 !1
          8        SEND_VAL                                                 <array>
          9        DO_ICALL                                                 
   10    10        INIT_NS_FCALL_BY_NAME                                    'Foo%5Cin_array'
         11        SEND_VAR_EX                                              !1
         12        SEND_VAL_EX                                              <array>
         13        SEND_VAL_EX                                              <true>
         14        DO_FCALL                                      0          
   12    15        IN_ARRAY                                         ~6      !1, <array>
         16        FREE                                                     ~6
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.91 ms | 1004 KiB | 14 Q