3v4l.org

run code in 500+ 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('C');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jOQY0
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                                                  'C'
          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/jOQY0
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/jOQY0
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.5.0


preferences:
189.99 ms | 2666 KiB | 13 Q