3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class ParentP { abstract public function doMaths($num); //returns int public function getMagicNumber() { return 50; } } class IMultiply extends ParentP { public function doMaths($num) { echo static::getMagicNumber() * $num; } } class IAdd extends ParentP { public function doMaths($num) { echo $this->getMagicNumber() + $number; } } $a = new IMultiply; $a->doMaths(2); // ----- $b = new IAdd; $b->doMaths(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3va43
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $2      'IMultiply'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   22     3        INIT_METHOD_CALL                                         !0, 'doMaths'
          4        SEND_VAL_EX                                              2
          5        DO_FCALL                                      0          
   24     6        NEW                                              $6      'IAdd'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   25     9        INIT_METHOD_CALL                                         !1, 'doMaths'
         10        SEND_VAL_EX                                              2
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

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

End of function domaths

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

End of function getmagicnumber

End of class ParentP.

Class IMultiply:
Function domaths:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3va43
function name:  doMaths
number of ops:  6
compiled vars:  !0 = $num
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        INIT_STATIC_METHOD_CALL                                  'getMagicNumber'
          2        DO_FCALL                                      0  $1      
          3        MUL                                              ~2      !0, $1
          4        ECHO                                                     ~2
          5      > RETURN                                                   null

End of function domaths

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

End of function getmagicnumber

End of class IMultiply.

Class IAdd:
Function domaths:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3va43
function name:  doMaths
number of ops:  6
compiled vars:  !0 = $num, !1 = $number
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        INIT_METHOD_CALL                                         'getMagicNumber'
          2        DO_FCALL                                      0  $2      
          3        ADD                                              ~3      $2, !1
          4        ECHO                                                     ~3
          5      > RETURN                                                   null

End of function domaths

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

End of function getmagicnumber

End of class IAdd.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.99 ms | 1399 KiB | 13 Q