3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); trait A { public static function bla(): string { return 'bla'; } } function bar(): string { return A::bla(); } function foo(): string { return (new class { use A; } )::bla(); } echo bar(); echo foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDDrq
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                                   'bar'
          1        DO_FCALL                                          0  $0      
          2        ECHO                                                         $0
   26     3        INIT_FCALL                                                   'foo'
          4        DO_FCALL                                          0  $1      
          5        ECHO                                                         $1
          6      > RETURN                                                       1

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDDrq
function name:  bar
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                      'A', 'bla'
          1        DO_FCALL                                          0  $0      
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
   16     4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function bar

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDDrq
function name:  foo
number of ops:  10
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   DECLARE_ANON_CLASS                                   <unknown> 
          1        NEW                                                  $1      $0
          2        DO_FCALL                                          0          
          3        FETCH_CLASS                                       0  $3      $1
          4        INIT_STATIC_METHOD_CALL                                      $3, 'bla'
          5        DO_FCALL                                          0  $4      
          6        VERIFY_RETURN_TYPE                                           $4
          7      > RETURN                                                       $4
   22     8*       VERIFY_RETURN_TYPE                                           
          9*     > RETURN                                                       null

End of function foo

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

End of function bla

End of class A.

Class class@anonymous: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
153.95 ms | 2117 KiB | 15 Q