3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function __construct($hours, $minutes) { $this->hours = (int) $hours; $this->minutes = (int) $minutes; } public static function a($time) { return new static(); } public static function b($time) { return new self(); } } var_dump(A::a()); #var_dump(A::b());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hgGgR
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'A', 'a'
          2        DO_FCALL                                      0  $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
   23     5      > RETURN                                                   1

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hgGgR
function name:  __construct
number of ops:  9
compiled vars:  !0 = $hours, !1 = $minutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        CAST                                          4  ~3      !0
          3        ASSIGN_OBJ                                               'hours'
          4        OP_DATA                                                  ~3
    8     5        CAST                                          4  ~5      !1
          6        ASSIGN_OBJ                                               'minutes'
          7        OP_DATA                                                  ~5
    9     8      > RETURN                                                   null

End of function __construct

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hgGgR
function name:  a
number of ops:  5
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        NEW                          static              $1      
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
   14     4*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hgGgR
function name:  b
number of ops:  5
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        NEW                          self                $1      
          2        DO_FCALL                                      0          
          3      > RETURN                                                   $1
   19     4*     > RETURN                                                   null

End of function b

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.88 ms | 1396 KiB | 15 Q