3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function getBar() { return new StdClass(['foo' => 'bar']); } } $foo = new Foo; if ($f = $foo->getBar() && $f->getFoo()) { echo 'yes'; } else { echo 'no'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
filename:       /in/XbTfC
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   12     3        INIT_METHOD_CALL                                         !0, 'getBar'
          4        DO_FCALL                                      0  $5      
          5      > JMPZ_EX                                          ~6      $5, ->9
          6    >   INIT_METHOD_CALL                                         !1, 'getFoo'
          7        DO_FCALL                                      0  $7      
          8        BOOL                                             ~6      $7
          9    >   ASSIGN                                           ~8      !1, ~6
         10      > JMPZ                                                     ~8, ->13
   13    11    >   ECHO                                                     'yes'
         12      > JMP                                                      ->14
   15    13    >   ECHO                                                     'no'
   16    14    > > RETURN                                                   1

Class Foo:
Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XbTfC
function name:  getBar
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   NEW                                              $0      'StdClass'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $0
    8     4*     > RETURN                                                   null

End of function getbar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.77 ms | 1394 KiB | 13 Q