3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function getBar() { return $this->bar; } public function setBar($bar) { $this->bar = $bar; } } function foo(Foo $foo) { if ($foo->getBar() === null) throw new InvalidArgumentException('Bar must not be null before foo\'ing'); } $foo = new Foo(); foo($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bjqgF
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'foo'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 9
Branch analysis from position: 5
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bjqgF
function name:  foo
number of ops:  10
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_METHOD_CALL                                         !0, 'getBar'
          2        DO_FCALL                                      0  $1      
          3        TYPE_CHECK                                    2          $1
          4      > JMPZ                                                     ~2, ->9
   12     5    >   NEW                                              $3      'InvalidArgumentException'
          6        SEND_VAL_EX                                              'Bar+must+not+be+null+before+foo%27ing'
          7        DO_FCALL                                      0          
          8      > THROW                                         0          $3
   13     9    > > RETURN                                                   null

End of function foo

Class Foo:
Function getbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bjqgF
function name:  getBar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   FETCH_OBJ_R                                      ~0      'bar'
          1      > RETURN                                                   ~0
          2*     > RETURN                                                   null

End of function getbar

Function setbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bjqgF
function name:  setBar
number of ops:  4
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function setbar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.21 ms | 1398 KiB | 14 Q