3v4l.org

run code in 300+ PHP versions simultaneously
<?php class obj { } function ret_true() { return true; } function ret_false() { return false; } function ret_obj() { return new obj(); } function ret_std() { return new stdClass(); } if ($a = ret_true() == true) { var_dump('true:true'); } if ($a = ret_true() == false) { var_dump('true:false'); } if ($a = ret_false() == true) { var_dump('false:true'); } if ($a = ret_false() == false) { var_dump('false:false'); } if ($a = ret_obj() instanceof obj) { var_dump('obj:obj'); } if ($a = ret_obj() instanceof stdClass) { var_dump('obj:std'); } if ($a = ret_std() instanceof obj) { var_dump('std:obj'); } if ($a = ret_std() instanceof stdClass) { var_dump('std:std'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 40
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 48
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 64
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
Branch analysis from position: 56
Branch analysis from position: 48
Branch analysis from position: 40
Branch analysis from position: 32
Branch analysis from position: 24
Branch analysis from position: 16
Branch analysis from position: 8
filename:       /in/9aiIh
function name:  (null)
number of ops:  65
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'ret_true'
          1        DO_FCALL                                      0  $1      
          2        BOOL                                             ~2      $1
          3        ASSIGN                                           ~3      !0, ~2
          4      > JMPZ                                                     ~3, ->8
   20     5    >   INIT_FCALL                                               'var_dump'
          6        SEND_VAL                                                 'true%3Atrue'
          7        DO_ICALL                                                 
   22     8    >   INIT_FCALL                                               'ret_true'
          9        DO_FCALL                                      0  $5      
         10        BOOL_NOT                                         ~6      $5
         11        ASSIGN                                           ~7      !0, ~6
         12      > JMPZ                                                     ~7, ->16
   23    13    >   INIT_FCALL                                               'var_dump'
         14        SEND_VAL                                                 'true%3Afalse'
         15        DO_ICALL                                                 
   26    16    >   INIT_FCALL                                               'ret_false'
         17        DO_FCALL                                      0  $9      
         18        BOOL                                             ~10     $9
         19        ASSIGN                                           ~11     !0, ~10
         20      > JMPZ                                                     ~11, ->24
   27    21    >   INIT_FCALL                                               'var_dump'
         22        SEND_VAL                                                 'false%3Atrue'
         23        DO_ICALL                                                 
   29    24    >   INIT_FCALL                                               'ret_false'
         25        DO_FCALL                                      0  $13     
         26        BOOL_NOT                                         ~14     $13
         27        ASSIGN                                           ~15     !0, ~14
         28      > JMPZ                                                     ~15, ->32
   30    29    >   INIT_FCALL                                               'var_dump'
         30        SEND_VAL                                                 'false%3Afalse'
         31        DO_ICALL                                                 
   34    32    >   INIT_FCALL                                               'ret_obj'
         33        DO_FCALL                                      0  $17     
         34        INSTANCEOF                                       ~18     $17, 'obj'
         35        ASSIGN                                           ~19     !0, ~18
         36      > JMPZ                                                     ~19, ->40
   35    37    >   INIT_FCALL                                               'var_dump'
         38        SEND_VAL                                                 'obj%3Aobj'
         39        DO_ICALL                                                 
   37    40    >   INIT_FCALL                                               'ret_obj'
         41        DO_FCALL                                      0  $21     
         42        INSTANCEOF                                       ~22     $21, 'stdClass'
         43        ASSIGN                                           ~23     !0, ~22
         44      > JMPZ                                                     ~23, ->48
   38    45    >   INIT_FCALL                                               'var_dump'
         46        SEND_VAL                                                 'obj%3Astd'
         47        DO_ICALL                                                 
   40    48    >   INIT_FCALL                                               'ret_std'
         49        DO_FCALL                                      0  $25     
         50        INSTANCEOF                                       ~26     $25, 'obj'
         51        ASSIGN                                           ~27     !0, ~26
         52      > JMPZ                                                     ~27, ->56
   41    53    >   INIT_FCALL                                               'var_dump'
         54        SEND_VAL                                                 'std%3Aobj'
         55        DO_ICALL                                                 
   43    56    >   INIT_FCALL                                               'ret_std'
         57        DO_FCALL                                      0  $29     
         58        INSTANCEOF                                       ~30     $29, 'stdClass'
         59        ASSIGN                                           ~31     !0, ~30
         60      > JMPZ                                                     ~31, ->64
   44    61    >   INIT_FCALL                                               'var_dump'
         62        SEND_VAL                                                 'std%3Astd'
         63        DO_ICALL                                                 
   45    64    > > RETURN                                                   1

Function ret_true:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9aiIh
function name:  ret_true
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > RETURN                                                   <true>
    8     1*     > RETURN                                                   null

End of function ret_true

Function ret_false:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9aiIh
function name:  ret_false
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   <false>
   11     1*     > RETURN                                                   null

End of function ret_false

Function ret_obj:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9aiIh
function name:  ret_obj
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'obj'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   14     3*     > RETURN                                                   null

End of function ret_obj

Function ret_std:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9aiIh
function name:  ret_std
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $0      'stdClass'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
   17     3*     > RETURN                                                   null

End of function ret_std

Class obj: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.5 ms | 1407 KiB | 23 Q