3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace { class Baz{ function foo(){ print_r(debug_backtrace()); } } function assertTrue(){} class PHPUnitThing{ function testSomething(){ $baz = new Baz(); assertTrue($baz->foo()); // dirty backtrace } } (new PHPUnitThing)->testSomething(); // dirty backtrace $baz = new Baz; assertTrue($baz->foo()); // clean backtrace }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIut2
function name:  (null)
number of ops:  13
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'PHPUnitThing'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'testSomething'
          3        DO_FCALL                                      0          
   21     4        NEW                                              $4      'Baz'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $4
   22     7        INIT_FCALL                                               'asserttrue'
          8        INIT_METHOD_CALL                                         !0, 'foo'
          9        DO_FCALL                                      0  $7      
         10        SEND_VAR                                                 $7
         11        DO_FCALL                                      0          
   23    12      > RETURN                                                   1

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

End of function asserttrue

Class Baz:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIut2
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'debug_backtrace'
          2        DO_ICALL                                         $0      
          3        SEND_VAR                                                 $0
          4        DO_ICALL                                                 
    7     5      > RETURN                                                   null

End of function foo

End of class Baz.

Class PHPUnitThing:
Function testsomething:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BIut2
function name:  testSomething
number of ops:  9
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Baz'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'asserttrue'
          4        INIT_METHOD_CALL                                         !0, 'foo'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_FCALL                                      0          
   16     8      > RETURN                                                   null

End of function testsomething

End of class PHPUnitThing.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.88 ms | 1004 KiB | 17 Q