3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($value) { if ($value == 'All' || $value === []) { return FALSE; } return TRUE; } function test2($value) { if ($value == 'All' || $value === 0 || $value === []) { return FALSE; } return TRUE; } var_dump(test(0)); var_dump(test2(0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1t3f1
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'test'
          2        SEND_VAL                                                 0
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
   18     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'test2'
          8        SEND_VAL                                                 0
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Function test:
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 = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/1t3f1
function name:  test
number of ops:  9
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        IS_EQUAL                                         ~1      !0, 'All'
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   IS_IDENTICAL                                     ~2      !0, <array>
          4        BOOL                                             ~1      ~2
          5    > > JMPZ                                                     ~1, ->7
    5     6    > > RETURN                                                   <false>
    7     7    > > RETURN                                                   <true>
    8     8*     > RETURN                                                   null

End of function test

Function test2:
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 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
Branch analysis from position: 5
filename:       /in/1t3f1
function name:  test2
number of ops:  12
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        IS_EQUAL                                         ~1      !0, 'All'
          2      > JMPNZ_EX                                         ~1      ~1, ->5
          3    >   IS_IDENTICAL                                     ~2      !0, 0
          4        BOOL                                             ~1      ~2
          5    > > JMPNZ_EX                                         ~1      ~1, ->8
          6    >   IS_IDENTICAL                                     ~3      !0, <array>
          7        BOOL                                             ~1      ~3
          8    > > JMPZ                                                     ~1, ->10
   12     9    > > RETURN                                                   <false>
   14    10    > > RETURN                                                   <true>
   15    11*     > RETURN                                                   null

End of function test2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139 ms | 1006 KiB | 16 Q