3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class D { protected function test1($class_name) { echo $class_name, "\n"; return 'BLAH'; } public function test($class_name) { return new $class_name($this->test1($class_name)); } } $D = new D; $D->test('A'); $D->test('D');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSvNH
function name:  (null)
number of ops:  10
compiled vars:  !0 = $D
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'D'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_METHOD_CALL                                         !0, 'test'
          4        SEND_VAL_EX                                              'A'
          5        DO_FCALL                                      0          
   21     6        INIT_METHOD_CALL                                         !0, 'test'
          7        SEND_VAL_EX                                              'D'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Class A: [no user functions]
Class D:
Function test1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSvNH
function name:  test1
number of ops:  5
compiled vars:  !0 = $class_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        ECHO                                                     !0
          2        ECHO                                                     '%0A'
   10     3      > RETURN                                                   'BLAH'
   11     4*     > RETURN                                                   null

End of function test1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rSvNH
function name:  test
number of ops:  10
compiled vars:  !0 = $class_name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        FETCH_CLASS                                   0  $1      !0
          2        NEW                                              $2      $1
          3        INIT_METHOD_CALL                                         'test1'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR_NO_REF_EX                                       $3
          7        DO_FCALL                                      0          
          8      > RETURN                                                   $2
   16     9*     > RETURN                                                   null

End of function test

End of class D.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.57 ms | 1386 KiB | 13 Q