3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Bar {} function takeObject(Object $obj) { var_dump(get_class($obj)); } takeObject(new Foo); takeObject(new Bar); takeObject('not an object');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Svuij
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'takeobject'
          1        NEW                                              $0      'Foo'
          2        DO_FCALL                                      0          
          3        SEND_VAR                                                 $0
          4        DO_FCALL                                      0          
   11     5        INIT_FCALL                                               'takeobject'
          6        NEW                                              $3      'Bar'
          7        DO_FCALL                                      0          
          8        SEND_VAR                                                 $3
          9        DO_FCALL                                      0          
   12    10        INIT_FCALL                                               'takeobject'
         11        SEND_VAL                                                 'not+an+object'
         12        DO_FCALL                                      0          
         13      > RETURN                                                   1

Function takeobject:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Svuij
function name:  takeObject
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'var_dump'
          2        GET_CLASS                                        ~1      !0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                                 
    8     5      > RETURN                                                   null

End of function takeobject

Class Foo: [no user functions]
Class Bar: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.04 ms | 1438 KiB | 17 Q