3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Slug { public function getSlug() { return $this->name; } } interface Sluggable { public function getSlug(); } class MyClass implements Sluggable { use Slug; protected $name; public function __construct($name) { $this->name = $name; } } var_dump((new MyClass('Kev'))->getSlug());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bPlb0
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_CLASS                                            'myclass'
   27     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'MyClass'
          3        SEND_VAL_EX                                              'Kev'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'getSlug'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function getslug

End of class Slug.

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

End of function getslug

End of class Sluggable.

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

End of function __construct

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.64 ms | 1396 KiB | 15 Q