3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $id; public static function byId($id) { self::__construct($id); } private function construct($id) { $this->id = $id; } } $a = A::byId(5); var_dump($a->id);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DZlGe
function name:  (null)
number of ops:  9
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'byId'
          1        SEND_VAL                                                 5
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   18     4        INIT_FCALL                                               'var_dump'
          5        FETCH_OBJ_R                                      ~3      !0, 'id'
          6        SEND_VAL                                                 ~3
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class A:
Function byid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DZlGe
function name:  byId
number of ops:  5
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_STATIC_METHOD_CALL                                  
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    9     4      > RETURN                                                   null

End of function byid

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

End of function construct

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.22 ms | 1387 KiB | 15 Q