3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyClass {} interface TestCon { public function testCon(MyClass $object): object; } class TestConImplementation implements TestCon { public function testCon(object $object): object { return $object; } } $test = new TestConImplementation; $object = $test->testCon(new MyClass); var_dump($object);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D1KWe
function name:  (null)
number of ops:  14
compiled vars:  !0 = $test, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'testconimplementation'
   19     1        NEW                                              $2      'TestConImplementation'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   20     4        INIT_METHOD_CALL                                         !0, 'testCon'
          5        NEW                                              $5      'MyClass'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $5
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
   21    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class MyClass: [no user functions]
Class TestCon:
Function testcon:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D1KWe
function name:  testCon
number of ops:  3
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function testcon

End of class TestCon.

Class TestConImplementation:
Function testcon:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/D1KWe
function name:  testCon
number of ops:  5
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        VERIFY_RETURN_TYPE                                       !0
          2      > RETURN                                                   !0
   16     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function testcon

End of class TestConImplementation.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.1 ms | 1396 KiB | 15 Q