3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ParentTest { public static function fromDB(string $name = '') { $instance = new static(); if (!empty($name)) { $instance->setName($name)->read(); } return $instance; } public abstract function read(); public abstract function setName(string $name): self; } class Child extends ParentTest { public function read() { } public function setName(string $name) :ParentTest { return $this; } } $child = new Child();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYf0Q
function name:  (null)
number of ops:  4
compiled vars:  !0 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'Child'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class ParentTest:
Function fromdb:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/IYf0Q
function name:  fromDB
number of ops:  14
compiled vars:  !0 = $name, !1 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
    6     1        NEW                          static              $2      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
    7     4        ISSET_ISEMPTY_CV                                 ~5      !0
          5        BOOL_NOT                                         ~6      ~5
          6      > JMPZ                                                     ~6, ->12
    8     7    >   INIT_METHOD_CALL                                         !1, 'setName'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $7      
         10        INIT_METHOD_CALL                                         $7, 'read'
         11        DO_FCALL                                      0          
   10    12    > > RETURN                                                   !1
   11    13*     > RETURN                                                   null

End of function fromdb

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

End of function read

Function setname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYf0Q
function name:  setName
number of ops:  3
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function setname

End of class ParentTest.

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

End of function read

Function setname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYf0Q
function name:  setName
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   RECV                                             !0      
   25     1        FETCH_THIS                                       ~1      
          2        VERIFY_RETURN_TYPE                                       ~1
          3      > RETURN                                                   ~1
   26     4*       VERIFY_RETURN_TYPE                                       
          5*     > RETURN                                                   null

End of function setname

Function fromdb:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/IYf0Q
function name:  fromDB
number of ops:  14
compiled vars:  !0 = $name, !1 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      ''
    6     1        NEW                          static              $2      
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $2
    7     4        ISSET_ISEMPTY_CV                                 ~5      !0
          5        BOOL_NOT                                         ~6      ~5
          6      > JMPZ                                                     ~6, ->12
    8     7    >   INIT_METHOD_CALL                                         !1, 'setName'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $7      
         10        INIT_METHOD_CALL                                         $7, 'read'
         11        DO_FCALL                                      0          
   10    12    > > RETURN                                                   !1
   11    13*     > RETURN                                                   null

End of function fromdb

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.43 ms | 1457 KiB | 14 Q