3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AAA { public function foo () { echo $this->childValue(); } abstract public function childValue(): string; } class XXXXXX extends AAA { public function childValue (): string { return "x"; } } class YYYYYY extends AAA { public function childValue (): string { return "y"; } } class ZZZZZZ extends AAA { public function childValue (): string { return "z"; } } //class WRONG extends AAA { // if empty: // Fatal error: Class WRONG contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (AAA::childValue) in /tmp/preview on line 29 //} $objX = new XXXXXX(); $objX->foo(); $objY = new YYYYYY(); $objY->foo(); $objZ = new ZZZZZZ(); $objZ->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  (null)
number of ops:  16
compiled vars:  !0 = $objX, !1 = $objY, !2 = $objZ
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   NEW                                              $3      'XXXXXX'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   35     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   36     5        NEW                                              $7      'YYYYYY'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $7
   37     8        INIT_METHOD_CALL                                         !1, 'foo'
          9        DO_FCALL                                      0          
   38    10        NEW                                              $11     'ZZZZZZ'
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !2, $11
   39    13        INIT_METHOD_CALL                                         !2, 'foo'
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Class AAA:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'childValue'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
    6     3      > RETURN                                                   null

End of function foo

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

End of function childvalue

End of class AAA.

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

End of function childvalue

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'childValue'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
    6     3      > RETURN                                                   null

End of function foo

End of class XXXXXX.

Class YYYYYY:
Function childvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  childValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   'y'
   20     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function childvalue

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'childValue'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
    6     3      > RETURN                                                   null

End of function foo

End of class YYYYYY.

Class ZZZZZZ:
Function childvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  childValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E > > RETURN                                                   'z'
   26     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function childvalue

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uo2fh
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_METHOD_CALL                                         'childValue'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
    6     3      > RETURN                                                   null

End of function foo

End of class ZZZZZZ.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.59 ms | 1000 KiB | 13 Q