3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IMyClass { public function myMeth(); } function my_class($name) { return new class($name) implements IMyClass{ public function __construct($name) { $this->name = $name; } public function myMeth() { return 'Hello ' . $this->name; } }; } echo my_class('Dwayne')->myMeth();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIm1Q
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'my_class'
          1        SEND_VAL                                                 'Dwayne'
          2        DO_FCALL                                      0  $0      
          3        INIT_METHOD_CALL                                         $0, 'myMeth'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Function my_class:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIm1Q
function name:  my_class
number of ops:  7
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        DECLARE_ANON_CLASS                               <undef> 
          2        NEW                                              $2      $1
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   $2
   16     6*     > RETURN                                                   null

End of function my_class

Class IMyClass:
Function mymeth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIm1Q
function name:  myMeth
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function mymeth

End of class IMyClass.

Class IMyClass@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIm1Q
function name:  __construct
number of ops:  4
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        ASSIGN_OBJ                                               'name'
          2        OP_DATA                                                  !0
   11     3      > RETURN                                                   null

End of function __construct

Function mymeth:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PIm1Q
function name:  myMeth
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      'Hello+', ~0
          2      > RETURN                                                   ~1
   14     3*     > RETURN                                                   null

End of function mymeth

End of class IMyClass@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.85 ms | 1403 KiB | 14 Q