3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $var = 1; public function dump(self $foo) { var_dump($foo); } } $foo = new Foo(); $foo->var = 10; $foo2 = new Foo(); $foo2->dump($foo); $foo2->dump(new stdClass);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VKvLZ
function name:  (null)
number of ops:  17
compiled vars:  !0 = $foo, !1 = $foo2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   14     3        ASSIGN_OBJ                                               !0, 'var'
          4        OP_DATA                                                  10
   16     5        NEW                                              $6      'Foo'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $6
   17     8        INIT_METHOD_CALL                                         !1, 'dump'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0          
   18    11        INIT_METHOD_CALL                                         !1, 'dump'
         12        NEW                                              $10     'stdClass'
         13        DO_FCALL                                      0          
         14        SEND_VAR_NO_REF_EX                                       $10
         15        DO_FCALL                                      0          
         16      > RETURN                                                   1

Class Foo:
Function dump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VKvLZ
function name:  dump
number of ops:  5
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   10     4      > RETURN                                                   null

End of function dump

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.11 ms | 1400 KiB | 15 Q