3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Example array $array = array( 'egg' => true, 'cheese' => false, 'hair' => 765, 'goblins' => null, 'ogres' => 'no ogres allowed in this array' ); // Loose checking -- return values are in comments print "Loose checking\n"; // First three make sense, last four do not var_dump(in_array(null, $array)); // true var_dump(in_array(false, $array)); // true var_dump(in_array(765, $array)); // true var_dump(in_array(763, $array)); // true var_dump(in_array('egg', $array)); // true var_dump(in_array('hhh', $array)); // true var_dump(in_array(array(), $array)); // true // Strict checking print "\n\nStrict checking\n"; var_dump(in_array(null, $array, true)); // true var_dump(in_array(false, $array, true)); // true var_dump(in_array(765, $array, true)); // true var_dump(in_array(763, $array, true)); // false var_dump(in_array('egg', $array, true)); // false var_dump(in_array('hhh', $array, true)); // false var_dump(in_array(array(), $array, true)); // false
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sr29Y
function name:  (null)
number of ops:  109
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
   14     1        ECHO                                                     'Loose+checking%0A'
   17     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'in_array'
          4        SEND_VAL                                                 null
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
   18     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'in_array'
         11        SEND_VAL                                                 <false>
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $4      
         14        SEND_VAR                                                 $4
         15        DO_ICALL                                                 
   19    16        INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'in_array'
         18        SEND_VAL                                                 765
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $6      
         21        SEND_VAR                                                 $6
         22        DO_ICALL                                                 
   20    23        INIT_FCALL                                               'var_dump'
         24        INIT_FCALL                                               'in_array'
         25        SEND_VAL                                                 763
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $8      
         28        SEND_VAR                                                 $8
         29        DO_ICALL                                                 
   21    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'in_array'
         32        SEND_VAL                                                 'egg'
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $10     
         35        SEND_VAR                                                 $10
         36        DO_ICALL                                                 
   22    37        INIT_FCALL                                               'var_dump'
         38        INIT_FCALL                                               'in_array'
         39        SEND_VAL                                                 'hhh'
         40        SEND_VAR                                                 !0
         41        DO_ICALL                                         $12     
         42        SEND_VAR                                                 $12
         43        DO_ICALL                                                 
   23    44        INIT_FCALL                                               'var_dump'
         45        INIT_FCALL                                               'in_array'
         46        SEND_VAL                                                 <array>
         47        SEND_VAR                                                 !0
         48        DO_ICALL                                         $14     
         49        SEND_VAR                                                 $14
         50        DO_ICALL                                                 
   26    51        ECHO                                                     '%0A%0AStrict+checking%0A'
   27    52        INIT_FCALL                                               'var_dump'
         53        INIT_FCALL                                               'in_array'
         54        SEND_VAL                                                 null
         55        SEND_VAR                                                 !0
         56        SEND_VAL                                                 <true>
         57        DO_ICALL                                         $16     
         58        SEND_VAR                                                 $16
         59        DO_ICALL                                                 
   28    60        INIT_FCALL                                               'var_dump'
         61        INIT_FCALL                                               'in_array'
         62        SEND_VAL                                                 <false>
         63        SEND_VAR                                                 !0
         64        SEND_VAL                                                 <true>
         65        DO_ICALL                                         $18     
         66        SEND_VAR                                                 $18
         67        DO_ICALL                                                 
   29    68        INIT_FCALL                                               'var_dump'
         69        INIT_FCALL                                               'in_array'
         70        SEND_VAL                                                 765
         71        SEND_VAR                                                 !0
         72        SEND_VAL                                                 <true>
         73        DO_ICALL                                         $20     
         74        SEND_VAR                                                 $20
         75        DO_ICALL                                                 
   30    76        INIT_FCALL                                               'var_dump'
         77        INIT_FCALL                                               'in_array'
         78        SEND_VAL                                                 763
         79        SEND_VAR                                                 !0
         80        SEND_VAL                                                 <true>
         81        DO_ICALL                                         $22     
         82        SEND_VAR                                                 $22
         83        DO_ICALL                                                 
   31    84        INIT_FCALL                                               'var_dump'
         85        INIT_FCALL                                               'in_array'
         86        SEND_VAL                                                 'egg'
         87        SEND_VAR                                                 !0
         88        SEND_VAL                                                 <true>
         89        DO_ICALL                                         $24     
         90        SEND_VAR                                                 $24
         91        DO_ICALL                                                 
   32    92        INIT_FCALL                                               'var_dump'
         93        INIT_FCALL                                               'in_array'
         94        SEND_VAL                                                 'hhh'
         95        SEND_VAR                                                 !0
         96        SEND_VAL                                                 <true>
         97        DO_ICALL                                         $26     
         98        SEND_VAR                                                 $26
         99        DO_ICALL                                                 
   33   100        INIT_FCALL                                               'var_dump'
        101        INIT_FCALL                                               'in_array'
        102        SEND_VAL                                                 <array>
        103        SEND_VAR                                                 !0
        104        SEND_VAL                                                 <true>
        105        DO_ICALL                                         $28     
        106        SEND_VAR                                                 $28
        107        DO_ICALL                                                 
        108      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.84 ms | 1455 KiB | 15 Q