3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait MyCustomProperty { private string $myString; private int $myInt; private array $myArray; } class MyClass { use MyCustomProperty; function __construct() { $this->myInt = 1; } public function getMyInt(): int { return $this->myInt; } } echo (new MyClass())->getMyInt();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uANuU
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_CLASS                                            'myclass'
   24     1        NEW                                              $0      'MyClass'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'getMyInt'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Class MyCustomProperty: [no user functions]
Class MyClass:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uANuU
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN_OBJ                                               'myInt'
          1        OP_DATA                                                  1
   16     2      > RETURN                                                   null

End of function __construct

Function getmyint:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uANuU
function name:  getMyInt
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'myInt'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   20     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getmyint

End of class MyClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.25 ms | 1007 KiB | 13 Q