3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dad { public function early() { print __CLASS__ . PHP_EOL; } public function late() { print get_class($this) . PHP_EOL; } public static function called() { print get_called_class . PHP_EOL; } } class Child extends Dad {} $parent = new Dad(); $child = new Child(); print 'PARENT' . PHP_EOL; $parent->early(); $parent->late(); $parent->called(); print 'CHILD' . PHP_EOL; $child->early(); $child->late(); $child->called();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  (null)
number of ops:  21
compiled vars:  !0 = $parent, !1 = $child
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Dad'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        NEW                                              $5      'Child'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !1, $5
   20     6        ECHO                                                     'PARENT%0A'
   21     7        INIT_METHOD_CALL                                         !0, 'early'
          8        DO_FCALL                                      0          
   22     9        INIT_METHOD_CALL                                         !0, 'late'
         10        DO_FCALL                                      0          
   23    11        INIT_METHOD_CALL                                         !0, 'called'
         12        DO_FCALL                                      0          
   24    13        ECHO                                                     'CHILD%0A'
   25    14        INIT_METHOD_CALL                                         !1, 'early'
         15        DO_FCALL                                      0          
   26    16        INIT_METHOD_CALL                                         !1, 'late'
         17        DO_FCALL                                      0          
   27    18        INIT_METHOD_CALL                                         !1, 'called'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Class Dad:
Function early:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  early
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'Dad%0A'
    6     1      > RETURN                                                   null

End of function early

Function late:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  late
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function late

Function called:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  called
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_CONSTANT                                   ~0      'get_called_class'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   12     3      > RETURN                                                   null

End of function called

End of class Dad.

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

End of function early

Function late:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  late
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~0      
          1        GET_CLASS                                        ~1      ~0
          2        CONCAT                                           ~2      ~1, '%0A'
          3        ECHO                                                     ~2
    9     4      > RETURN                                                   null

End of function late

Function called:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vrfOL
function name:  called
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_CONSTANT                                   ~0      'get_called_class'
          1        CONCAT                                           ~1      ~0, '%0A'
          2        ECHO                                                     ~1
   12     3      > RETURN                                                   null

End of function called

End of class Child.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.13 ms | 1399 KiB | 13 Q