3v4l.org

run code in 300+ PHP versions simultaneously
<?php class WhoCalledMe { function WhoCalledMe() { $calledMe = get_called_class(); echo "$calledMe called me\n"; } } class Test { function runTest() { $_whoCalled = new WhoCalledMe(); $_whoCalled->WhoCalledMe(); } } $myTest = new Test(); $myTest->runTest();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/df9LX
function name:  (null)
number of ops:  6
compiled vars:  !0 = $myTest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'runTest'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class WhoCalledMe:
Function whocalledme:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/df9LX
function name:  WhoCalledMe
number of ops:  6
compiled vars:  !0 = $calledMe
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   GET_CALLED_CLASS                                 ~1      
          1        ASSIGN                                                   !0, ~1
    6     2        NOP                                                      
          3        FAST_CONCAT                                      ~3      !0, '+called+me%0A'
          4        ECHO                                                     ~3
    7     5      > RETURN                                                   null

End of function whocalledme

End of class WhoCalledMe.

Class Test:
Function runtest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/df9LX
function name:  runTest
number of ops:  6
compiled vars:  !0 = $_whoCalled
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'WhoCalledMe'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'WhoCalledMe'
          4        DO_FCALL                                      0          
   14     5      > RETURN                                                   null

End of function runtest

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.81 ms | 1398 KiB | 13 Q