3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function getBar() { return new StdClass(['foo' => 'bar']); } } $foo = new Foo; $f = $foo->getBar(); if ($f && $f->getFoo()) { echo 'yes'; } else { echo 'no'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
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: 10
filename:       /in/Gc613
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        ASSIGN                                                   !1, $5
   13     6      > JMPZ_EX                                          ~7      !1, ->10
          7    >   INIT_METHOD_CALL                                         !1, 'getFoo'
          8        DO_FCALL                                      0  $8      
          9        BOOL                                             ~7      $8
         10    > > JMPZ                                                     ~7, ->13
   14    11    >   ECHO                                                     'yes'
         12      > JMP                                                      ->14
   16    13    >   ECHO                                                     'no'
   17    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/Gc613
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:
144.18 ms | 1398 KiB | 13 Q