3v4l.org

run code in 300+ PHP versions simultaneously
<?php function complexCheck($possibleArray) { return is_array($possibleArray) && !empty($possibleArray); } function simpleCheck($possibleArray) { return $possibleArray !== []; } $array = 1; var_dump(complexCheck($array), simpleCheck($array));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egtb5
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 1
   13     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'complexcheck'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        INIT_FCALL                                               'simplecheck'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $3      
          9        SEND_VAR                                                 $3
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function complexcheck:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/egtb5
function name:  complexCheck
number of ops:  8
compiled vars:  !0 = $possibleArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        TYPE_CHECK                                  128  ~1      !0
          2      > JMPZ_EX                                          ~1      ~1, ->6
          3    >   ISSET_ISEMPTY_CV                                 ~2      !0
          4        BOOL_NOT                                         ~3      ~2
          5        BOOL                                             ~1      ~3
          6    > > RETURN                                                   ~1
    5     7*     > RETURN                                                   null

End of function complexcheck

Function simplecheck:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/egtb5
function name:  simpleCheck
number of ops:  4
compiled vars:  !0 = $possibleArray
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        IS_NOT_IDENTICAL                                 ~1      !0, <array>
          2      > RETURN                                                   ~1
    9     3*     > RETURN                                                   null

End of function simplecheck

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.17 ms | 1454 KiB | 16 Q